D3D9: Force branch usage for fog compute.

When using `[flatten]`/default, it picks the wrong value, seemingly always
taking the else case (even if the condition is changed or reversed.)
This commit is contained in:
Unknown W. Brackets 2023-01-06 17:25:04 -08:00
parent 81f4a76ac9
commit f49f7c6371

View file

@ -1283,7 +1283,9 @@ bool GenerateVertexShader(const VShaderID &id, char *buffer, const ShaderLanguag
}
}
// Compute fogdepth
// Compute fogdepth. [branch] works around an apparent d3d9 shader compiler bug.
if (compat.shaderLanguage == HLSL_D3D9)
WRITE(p, " [branch]\n");
WRITE(p, " if (u_fogcoef.x <= -65535.0 && u_fogcoef.y <= -65535.0) {\n");
WRITE(p, " %sv_fogdepth = 1.0;\n", compat.vsOutPrefix);
WRITE(p, " } else {\n");