diff --git a/GPU/Common/VertexShaderGenerator.cpp b/GPU/Common/VertexShaderGenerator.cpp index a4d8c68a63..d92a3347e4 100644 --- a/GPU/Common/VertexShaderGenerator.cpp +++ b/GPU/Common/VertexShaderGenerator.cpp @@ -1135,7 +1135,10 @@ bool GenerateVertexShader(const VShaderID &id, char *buffer, const ShaderLanguag WRITE(p, " if (u_cullRangeMin.w > 0.0) {\n"); WRITE(p, " %sgl_CullDistance%s = projPos.z - u_cullRangeMin.z;\n", compat.vsOutPrefix, cull0); WRITE(p, " %sgl_CullDistance%s = u_cullRangeMax.z - projPos.z;\n", compat.vsOutPrefix, cull1); - WRITE(p, " }\n"); + WRITE(p, " } else {\n"); + WRITE(p, " %sgl_CullDistance%s = 0.0;\n", compat.vsOutPrefix, cull0); + WRITE(p, " %sgl_CullDistance%s = 0.0;\n", compat.vsOutPrefix, cull1); + WRITE(p, " }"); } }