Nvm fix mul properly

Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
This commit is contained in:
Isaac Marovitz 2025-03-21 13:34:14 -04:00
parent 9112665766
commit 2d9e24c52f
No known key found for this signature in database
GPG key ID: 97250B2B09A132E1
2 changed files with 6 additions and 4 deletions

View file

@ -168,6 +168,12 @@ float rcp(T a)
{
return 1.0 / a;
}
template<typename T>
float4x4 mul(T a, T b)
{
a * b;
}
#endif
#ifdef __air__

View file

@ -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";