Only emit the texgens if they are used, not every single time do all of them.

This commit is contained in:
Ryan Houdek
2013-10-06 20:07:16 -05:00
parent cf1b634c33
commit d4bd5fde71
2 changed files with 6 additions and 7 deletions

View File

@ -319,7 +319,8 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
if (xfregs.numTexGen.numTexGens < 7)
{
for (int i = 0; i < 8; ++i)
out.Write("VARYIN float3 uv%d_2;\n", i);
if(i < xfregs.numTexGen.numTexGens)
out.Write("VARYIN float3 uv%d_2;\n", i);
out.Write("VARYIN float4 clipPos_2;\n");
if (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
{
@ -437,7 +438,8 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
{
if(numTexgen)
for (int i = 0; i < 8; ++i)
out.Write("float3 uv%d = uv%d_2;\n", i, i);
if(i < xfregs.numTexGen.numTexGens)
out.Write("float3 uv%d = uv%d_2;\n", i, i);
out.Write("float4 clipPos = clipPos_2;\n");
if (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
{