From 2d9e24c52f5186df82d9230513594311258dd023 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Fri, 21 Mar 2025 13:34:14 -0400 Subject: [PATCH] Nvm fix mul properly Signed-off-by: Isaac Marovitz --- XenosRecomp/shader_common.h | 6 ++++++ XenosRecomp/shader_recompiler.cpp | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/XenosRecomp/shader_common.h b/XenosRecomp/shader_common.h index 04652cb..28c83af 100644 --- a/XenosRecomp/shader_common.h +++ b/XenosRecomp/shader_common.h @@ -168,6 +168,12 @@ float rcp(T a) { return 1.0 / a; } + +template +float4x4 mul(T a, T b) +{ + a * b; +} #endif #ifdef __air__ diff --git a/XenosRecomp/shader_recompiler.cpp b/XenosRecomp/shader_recompiler.cpp index d9fed7d..5f7564a 100644 --- a/XenosRecomp/shader_recompiler.cpp +++ b/XenosRecomp/shader_recompiler.cpp @@ -1501,11 +1501,7 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi out += "\toPos = 0.0;\n"; out += "\tfloat4x4 mtxProjection = float4x4(g_MtxProjection(0), g_MtxProjection(1), g_MtxProjection(2), g_MtxProjection(3));\n"; - out += "#ifdef __air__\n"; - out += "\tfloat4x4 mtxProjectionReverseZ = mtxProjection * float4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 1, 1);\n"; - out += "#else\n"; out += "\tfloat4x4 mtxProjectionReverseZ = mul(mtxProjection, float4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 1, 1));\n"; - out += "#endif\n"; out += "\t[unroll] for (int iterationIndex = 0; iterationIndex < 2; iterationIndex++)\n"; out += "\t{\n";