diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp index a42f090716..469f273d89 100644 --- a/Source/Core/VideoCommon/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/VertexShaderGen.cpp @@ -381,6 +381,14 @@ ShaderCode GenerateVertexShaderCode(APIType api_type, const vertex_shader_uid_da i, i, i, i); } + // TODO write comment + // TODO check if it only affects XF_TEXGEN_REGULAR more + if (texinfo.texgentype == XF_TEXGEN_REGULAR) + { + out.Write("if(o.tex%d.z == 0.0f)\n", i); + out.Write("\to.tex%d.xy = clamp(o.tex%d.xy / 2.0f, float2(-1.0f), float2(1.0f));\n", i, i); + } + out.Write("}\n"); }