From 02eebb8595c7b36547532239fdf007d3f615ef18 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Sat, 3 Apr 2021 16:48:50 +0200 Subject: [PATCH] [util] introduce a raw constructor for Matrix4 --- src/util/util_matrix.h | 7 +++++++ src/util/util_vector.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/util/util_matrix.h b/src/util/util_matrix.h index 50a9ee25..4e386628 100644 --- a/src/util/util_matrix.h +++ b/src/util/util_matrix.h @@ -35,6 +35,13 @@ namespace dxvk { data[3] = v3; } + inline Matrix4(const float matrix[4][4]) { + data[0] = Vector4(matrix[0]); + data[1] = Vector4(matrix[1]); + data[2] = Vector4(matrix[2]); + data[3] = Vector4(matrix[3]); + } + Matrix4(const Matrix4& other) = default; Vector4& operator[](size_t index); diff --git a/src/util/util_vector.h b/src/util/util_vector.h index d25dd2f1..5111a9eb 100644 --- a/src/util/util_vector.h +++ b/src/util/util_vector.h @@ -18,7 +18,7 @@ namespace dxvk { Vector4Base(T x, T y, T z, T w) : x(x), y(y), z(z), w(w) { } - Vector4Base(T xyzw[4]) + Vector4Base(const T xyzw[4]) : x(xyzw[0]), y(xyzw[1]), z(xyzw[2]), w(xyzw[3]) { } Vector4Base(const Vector4Base& other) = default;