Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ShaderGen: remove nonsense for() if() {}
  • Loading branch information
degasus committed Oct 15, 2013
1 parent 72c1e14 commit f625797
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions Source/Core/VideoCommon/Src/PixelShaderGen.cpp
Expand Up @@ -318,9 +318,8 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
// Let's set up attributes
if (xfregs.numTexGen.numTexGens < 7)
{
for (int i = 0; i < 8; ++i)
if(i < xfregs.numTexGen.numTexGens)
out.Write("VARYIN float3 uv%d_2;\n", i);
for (int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
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)
{
Expand Down
5 changes: 2 additions & 3 deletions Source/Core/VideoCommon/Src/VertexShaderGen.cpp
Expand Up @@ -483,9 +483,8 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ

if (xfregs.numTexGen.numTexGens < 7)
{
for (unsigned int i = 0; i < 8; ++i)
if(i < xfregs.numTexGen.numTexGens)
out.Write(" uv%d_2.xyz = o.tex%d;\n", i, i);
for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
out.Write(" uv%d_2.xyz = o.tex%d;\n", i, i);
out.Write(" clipPos_2 = o.clipPos;\n");
if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
out.Write(" Normal_2 = o.Normal;\n");
Expand Down

0 comments on commit f625797

Please sign in to comment.