From 10567cb23fcaf980936ce576a4fcad1dfaa36cca Mon Sep 17 00:00:00 2001 From: degasus Date: Thu, 7 Feb 2013 13:23:20 +0100 Subject: [PATCH] always write to uv coords --- Source/Core/VideoCommon/Src/VertexShaderGen.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp index dc66041643..42b63f0929 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp @@ -586,8 +586,11 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType) // clipPos/w needs to be done in pixel shader, not here if (xfregs.numTexGen.numTexGens < 7) { - for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i) - WRITE(p, " uv%d_2.xyz = o.tex%d;\n", i, i); + for (unsigned int i = 0; i < 8; ++i) + if(i < xfregs.numTexGen.numTexGens) + WRITE(p, " uv%d_2.xyz = o.tex%d;\n", i, i); + else + WRITE(p, " uv%d_2.xyz = float3(0.0f, 0.0f, 0.0f);\n", i); WRITE(p, " clipPos_2 = o.clipPos;\n"); if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting) WRITE(p, " Normal_2 = o.Normal;\n");