summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/UberShaderPixel.cpp
diff options
context:
space:
mode:
authorPokechu22 <Pokechu022@gmail.com>2021-10-13 20:43:32 -0700
committerPokechu22 <Pokechu022@gmail.com>2021-10-13 20:43:32 -0700
commita372a5947b65166ca7bf9f41507191ba12bec253 (patch)
tree71c5e6c0941912a5c395f5ccd5eb03eec45ec06a /Source/Core/VideoCommon/UberShaderPixel.cpp
parent023eb0b7029eb3633ce9eeb039c11d835ea7fd74 (diff)
VideoCommon: Fix color channel logic when per-pixel lighting is in use
This was broken in #10012 (specifically by 06579e4d53844e5a45ae18f8eda6c4ee69ebad2c and c3dec343918ff44e90886daf71a6bf0c49033de1).
Diffstat (limited to 'Source/Core/VideoCommon/UberShaderPixel.cpp')
-rw-r--r--Source/Core/VideoCommon/UberShaderPixel.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/UberShaderPixel.cpp b/Source/Core/VideoCommon/UberShaderPixel.cpp
index f7c5d4c309..4541f15b10 100644
--- a/Source/Core/VideoCommon/UberShaderPixel.cpp
+++ b/Source/Core/VideoCommon/UberShaderPixel.cpp
@@ -748,6 +748,14 @@ ShaderCode GenPixelShader(APIType api_type, const ShaderHostConfig& host_config,
WriteVertexLighting(out, api_type, "lit_pos", "lit_normal", "colors_0", "colors_1",
"lit_colors_0", "lit_colors_1");
color_input_prefix = "lit_";
+ out.Write(" // The number of colors available to TEV is determined by numColorChans.\n"
+ " // Normally this is performed in the vertex shader after lighting,\n"
+ " // but with per-pixel lighting, we need to perform it here.\n"
+ " // TODO: Actually implement this for ubershaders\n"
+ " // if (xfmem_numColorChans == 0u)\n"
+ " // o.colors_0 = float4(0.0, 0.0, 0.0, 0.0);\n"
+ " // if (xfmem_numColorChans <= 1u)\n"
+ " // o.colors_1 = float4(0.0, 0.0, 0.0, 0.0);\n");
}
out.Write(" uint num_stages = {};\n\n",