summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/UberShaderVertex.cpp
diff options
context:
space:
mode:
authorAnthony <Helios747@users.noreply.github.com>2017-11-21 20:17:18 -0800
committerGitHub <noreply@github.com>2017-11-21 20:17:18 -0800
commit066471be076994ea8538d13e8d6979609193a2de (patch)
tree6be0e38fd495292ee5f5d63471732164254cccac /Source/Core/VideoCommon/UberShaderVertex.cpp
parentf2f50d4fe5e0f97d36d6d132f40516ad6174601f (diff)
parentefb97598629b96378edd783af82936185d8a99ce (diff)
Merge pull request #4601 from stenzek/celdamage-lighting
ShaderGen: Always calculate lighting for both color channels
Diffstat (limited to 'Source/Core/VideoCommon/UberShaderVertex.cpp')
-rw-r--r--Source/Core/VideoCommon/UberShaderVertex.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/UberShaderVertex.cpp b/Source/Core/VideoCommon/UberShaderVertex.cpp
index ebc9c80f0e..bf24f6afda 100644
--- a/Source/Core/VideoCommon/UberShaderVertex.cpp
+++ b/Source/Core/VideoCommon/UberShaderVertex.cpp
@@ -171,6 +171,19 @@ ShaderCode GenVertexShader(APIType ApiType, const ShaderHostConfig& host_config,
if (numTexgen > 0)
GenVertexShaderTexGens(ApiType, numTexgen, out);
+ out.Write("if (xfmem_numColorChans == 0u) {\n");
+ out.Write(" if ((components & %uu) != 0u)\n", VB_HAS_COL0);
+ out.Write(" o.colors_0 = rawcolor0;\n");
+ out.Write(" else\n");
+ out.Write(" o.colors_1 = float4(1.0, 1.0, 1.0, 1.0);\n");
+ out.Write("}\n");
+ out.Write("if (xfmem_numColorChans < 2u) {\n");
+ out.Write(" if ((components & %uu) != 0u)\n", VB_HAS_COL1);
+ out.Write(" o.colors_0 = rawcolor1;\n");
+ out.Write(" else\n");
+ out.Write(" o.colors_1 = float4(1.0, 1.0, 1.0, 1.0);\n");
+ out.Write("}\n");
+
// clipPos/w needs to be done in pixel shader, not here
out.Write("o.clipPos = o.pos;\n");