summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJules Blok <jules.blok@gmail.com>2015-01-20 23:06:24 +0100
committerJules Blok <jules.blok@gmail.com>2015-01-20 23:15:01 +0100
commitf40cd04a29cbdb067849ec56240c331a3f66b299 (patch)
treea698a9523d934cb42553084a07ff4aaf08e8bf03 /Source/Core
parent714697faafd85b67730e0c891e57b89d493bb115 (diff)
PixelShaderGen: Fix uninitialized variables.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/VideoCommon/PixelShaderGen.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp
index 1d57a1edf6..f239f61171 100644
--- a/Source/Core/VideoCommon/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/PixelShaderGen.cpp
@@ -390,6 +390,11 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
"\tint2 wrappedcoord=int2(0,0), tempcoord=int2(0,0);\n"
"\tint4 tevin_a=int4(0,0,0,0),tevin_b=int4(0,0,0,0),tevin_c=int4(0,0,0,0),tevin_d=int4(0,0,0,0);\n\n"); // tev combiner inputs
+ // On GLSL, input variables must not be assigned to.
+ // This is why we declare these variables locally instead.
+ out.Write("\tfloat4 col0 = colors_0;\n");
+ out.Write("\tfloat4 col1 = colors_1;\n");
+
if (g_ActiveConfig.bEnablePixelLighting)
{
out.Write("\tfloat3 _norm0 = normalize(Normal.xyz);\n\n");
@@ -399,10 +404,6 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
"\tfloat3 ldir, h;\n"
"\tfloat dist, dist2, attn;\n");
- // On GLSL, input variables must not be assigned to.
- // This is why we declare these variables locally instead.
- out.Write("\tfloat4 col0, col1;\n");
-
// TODO: Our current constant usage code isn't able to handle more than one buffer.
// So we can't mark the VS constant as used here. But keep them here as reference.
//out.SetConstantsUsed(C_PLIGHT_COLORS, C_PLIGHT_COLORS+7); // TODO: Can be optimized further
@@ -411,11 +412,6 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
uid_data->components = components;
GenerateLightingShader<T>(out, uid_data->lighting, components, "colors_", "col");
}
- else
- {
- out.Write("\tfloat4 col0 = colors_0;\n");
- out.Write("\tfloat4 col1 = colors_1;\n");
- }
// HACK to handle cases where the tex gen is not enabled
if (numTexgen == 0)