From fc0b1eef4c4bf28475993b13b60d5b98b10e9020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 31 Jan 2025 15:06:57 +0100 Subject: [PATCH] Fix 4x4 --- Common/Math/CrossSIMD.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Common/Math/CrossSIMD.h b/Common/Math/CrossSIMD.h index 91e4f48673..762180aba7 100644 --- a/Common/Math/CrossSIMD.h +++ b/Common/Math/CrossSIMD.h @@ -1222,12 +1222,11 @@ inline void TranslateAndScaleInplace(Mat4F32 &m, Vec4F32 scale, Vec4F32 translat inline Mat4F32 Mul4x4By4x4(Mat4F32 a, Mat4F32 b) { Mat4F32 result; - for (int j = 0; j < 4; j++) { for (int i = 0; i < 4; i++) { float sum = 0.0f; for (int k = 0; k < 4; k++) { - sum += b.m[i * 4 + k] * a.m[k * 4 + j]; + sum += b.m[k * 4 + i] * a.m[j * 4 + k]; } result.m[j * 4 + i] = sum; }