summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PixelShaderGen.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2020-11-21 02:55:50 +0100
committerGitHub <noreply@github.com>2020-11-21 02:55:50 +0100
commit608dd6a37b1f0208340063b5ffe34193eea7ebc3 (patch)
treef271cab8f4c9b0a80a58fcd7118f668898a009e1 /Source/Core/VideoCommon/PixelShaderGen.cpp
parentfa73b1a23f9b0c5104909de410f9ae533cbf8af4 (diff)
parentd6ce8eef36f5b0bfd0078c51701b052cc9a77005 (diff)
Merge pull request #9122 from Pokechu22/pr-4601-test
Fix Super Mario Sunshine debug cubes (originally PR #4601 by stenzek)
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/PixelShaderGen.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp
index b51fee3acb..30bd725cb7 100644
--- a/Source/Core/VideoCommon/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/PixelShaderGen.cpp
@@ -203,9 +203,6 @@ PixelShaderUid GetPixelShaderUid()
if (g_ActiveConfig.bEnablePixelLighting)
{
- // The lighting shader only needs the two color bits of the 23bit component bit array.
- uid_data->components =
- (VertexLoaderManager::g_current_components & (VB_HAS_COL0 | VB_HAS_COL1)) >> VB_COL_SHIFT;
uid_data->numColorChans = xfmem.numChan.numColorChans;
GetLightingShaderUid(uid_data->lighting);
}
@@ -768,8 +765,11 @@ ShaderCode GeneratePixelShaderCode(APIType api_type, const ShaderHostConfig& hos
// out.SetConstantsUsed(C_PLIGHT_COLORS, C_PLIGHT_COLORS+7); // TODO: Can be optimized further
// out.SetConstantsUsed(C_PLIGHTS, C_PLIGHTS+31); // TODO: Can be optimized further
// out.SetConstantsUsed(C_PMATERIALS, C_PMATERIALS+3);
- GenerateLightingShaderCode(out, uid_data->lighting, uid_data->components << VB_COL_SHIFT,
- "colors_", "col");
+ GenerateLightingShaderCode(out, uid_data->lighting, "colors_", "col");
+ if (uid_data->numColorChans == 0)
+ out.Write("col0 = float4(0.0, 0.0, 0.0, 0.0);\n");
+ if (uid_data->numColorChans <= 1)
+ out.Write("col1 = float4(0.0, 0.0, 0.0, 0.0);\n");
}
// HACK to handle cases where the tex gen is not enabled