Skip to content

Commit

Permalink
Merge branch 'dev/ralston/explicit_vectors_2' into 'main'
Browse files Browse the repository at this point in the history
Explicit Vector Constructor Fix

See merge request lightspeedrtx/dxvk-remix-nv!768
  • Loading branch information
anon-apple committed Apr 2, 2024
2 parents 7e24a52 + 126e845 commit 7814e6d
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/util/util_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ namespace dxvk {

// Identity
inline Matrix4Base() {
data[0] = { 1, 0, 0, 0 };
data[1] = { 0, 1, 0, 0 };
data[2] = { 0, 0, 1, 0 };
data[3] = { 0, 0, 0, 1 };
data[0] = Vector4Base<T>{ 1, 0, 0, 0 };
data[1] = Vector4Base<T>{ 0, 1, 0, 0 };
data[2] = Vector4Base<T>{ 0, 0, 1, 0 };
data[3] = Vector4Base<T>{ 0, 0, 0, 1 };
}

// Produces a scalar matrix, x * Identity
inline explicit Matrix4Base(T x) {
data[0] = { x, 0, 0, 0 };
data[1] = { 0, x, 0, 0 };
data[2] = { 0, 0, x, 0 };
data[3] = { 0, 0, 0, x };
data[0] = Vector4Base<T>{ x, 0, 0, 0 };
data[1] = Vector4Base<T>{ 0, x, 0, 0 };
data[2] = Vector4Base<T>{ 0, 0, x, 0 };
data[3] = Vector4Base<T>{ 0, 0, 0, x };
}

inline Matrix4Base(
Expand Down Expand Up @@ -91,9 +91,9 @@ namespace dxvk {
}

explicit inline Matrix4Base(const Vector3Base<T> translation) {
data[0] = { 1, 0, 0, 0 };
data[1] = { 0, 1, 0, 0 };
data[2] = { 0, 0, 1, 0 };
data[0] = Vector4Base<T>{ 1, 0, 0, 0 };
data[1] = Vector4Base<T>{ 0, 1, 0, 0 };
data[2] = Vector4Base<T>{ 0, 0, 1, 0 };
data[3] = Vector4Base<T>(translation.x, translation.y, translation.z, 1.f);
}

Expand Down Expand Up @@ -440,16 +440,16 @@ namespace dxvk {

// Identity
inline Matrix3() {
data[0] = { 1, 0, 0 };
data[1] = { 0, 1, 0 };
data[2] = { 0, 0, 1 };
data[0] = Vector3{ 1, 0, 0 };
data[1] = Vector3{ 0, 1, 0 };
data[2] = Vector3{ 0, 0, 1 };
}

// Produces a scalar matrix, x * Identity
inline explicit Matrix3(float x) {
data[0] = { x, 0, 0 };
data[1] = { 0, x, 0 };
data[2] = { 0, 0, x };
data[0] = Vector3{ x, 0, 0 };
data[1] = Vector3{ 0, x, 0 };
data[2] = Vector3{ 0, 0, x };
}

inline Matrix3(
Expand Down

0 comments on commit 7814e6d

Please sign in to comment.