diff options
| author | JMC47 <JMC4789@gmail.com> | 2021-06-10 03:38:24 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-10 03:38:24 -0400 |
| commit | a51d01bb809bddaa2c221b0e9a6d0b935a285bce (patch) | |
| tree | a8ebb37fd0c90eb6adc89b27fc3f82dc694ee26e /Source/Core/VideoCommon/VertexShaderManager.cpp | |
| parent | e62610e6bc4f33234d8d5a7759ed5911bd25b8cb (diff) | |
| parent | 1500a0119bbb9086b0482a94b154612a0684f194 (diff) | |
Merge pull request #9532 from Pokechu22/debug-cube-hack
Hackfix for debug cubes
Diffstat (limited to 'Source/Core/VideoCommon/VertexShaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexShaderManager.cpp | 23 |
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) |
