summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexShaderManager.cpp
diff options
context:
space:
mode:
authorPokechu22 <Pokechu022@gmail.com>2021-02-22 19:03:06 -0800
committerPokechu22 <Pokechu022@gmail.com>2021-06-09 20:50:49 -0700
commitc583cac5681409222c4557e48cbad8caedc17c4d (patch)
tree25323f4fcbf4acf96d3093c309fef8527e76b218 /Source/Core/VideoCommon/VertexShaderManager.cpp
parente62610e6bc4f33234d8d5a7759ed5911bd25b8cb (diff)
Hack to hide debug cubes in Super Mario Sunshine
... while not breaking other games.
Diffstat (limited to 'Source/Core/VideoCommon/VertexShaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexShaderManager.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp
index 8047714f61..fa999d7d3e 100644
--- a/Source/Core/VideoCommon/VertexShaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexShaderManager.cpp
@@ -136,6 +136,18 @@ void VertexShaderManager::Dirty()
// TODO: A cleaner way to control the matrices without making a mess in the parameters field
void VertexShaderManager::SetConstants()
{
+ if (constants.missing_color_hex != g_ActiveConfig.iMissingColorValue)
+ {
+ const float a = (g_ActiveConfig.iMissingColorValue) & 0xFF;
+ const float b = (g_ActiveConfig.iMissingColorValue >> 8) & 0xFF;
+ const float g = (g_ActiveConfig.iMissingColorValue >> 16) & 0xFF;
+ const float r = (g_ActiveConfig.iMissingColorValue >> 24) & 0xFF;
+ constants.missing_color_hex = g_ActiveConfig.iMissingColorValue;
+ constants.missing_color_value = {r / 255, g / 255, b / 255, a / 255};
+
+ dirty = true;
+ }
+
if (nTransformMatricesChanged[0] >= 0)
{
int startn = nTransformMatricesChanged[0] / 4;
@@ -615,17 +627,6 @@ void VertexShaderManager::SetVertexFormat(u32 components)
constants.components = components;
dirty = true;
}
-
- // The default alpha channel seems to depend on the number of components in the vertex format.
- // If the vertex attribute has an alpha channel, zero is used, otherwise one.
- const auto g0 = g_main_cp_state.vtx_attr[g_main_cp_state.last_id].g0;
- const u32 color_chan_alpha = (g0.Color0Elements == ColorComponentCount::RGB ? 1 : 0) |
- (g0.Color1Elements == ColorComponentCount::RGB ? 2 : 0);
- if (color_chan_alpha != constants.color_chan_alpha)
- {
- constants.color_chan_alpha = color_chan_alpha;
- dirty = true;
- }
}
void VertexShaderManager::SetTexMatrixInfoChanged(int index)