handle halfZ in the shader decompiler

This commit is contained in:
Samuliak 2024-11-15 17:01:21 +01:00
parent d732416569
commit 38cbd3e03a
No known key found for this signature in database
2 changed files with 11 additions and 11 deletions

View file

@ -392,6 +392,11 @@ namespace LatteDecompiler
}
}
if (decompilerContext->contextRegistersNew->PA_CL_CLIP_CNTL.get_DX_CLIP_SPACE_DEF())
src->add("#define SET_POSITION(_v) out.position = _v" _CRLF);
else
src->add("#define SET_POSITION(_v) out.position = _v; out.position.z = (out.position.z + out.position.w) / 2.0" _CRLF);
const bool dump_shaders_enabled = ActiveSettings::DumpShadersEnabled();
if(dump_shaders_enabled)
decompilerContext->shaderSource->add("// start of shader inputs/outputs, predetermined by Cemu. Do not touch" _CRLF);