diff options
| author | JMC47 <JMC4789@gmail.com> | 2022-06-28 13:35:39 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-28 13:35:39 -0400 |
| commit | 5d04e1e1de8248da8366f6f99ff4cdbe5467c789 (patch) | |
| tree | 47ff1e96f099cef3443635b982d03e2bf1ce3f04 /Source/Core/VideoCommon/VertexShaderManager.cpp | |
| parent | e50e45f400856191eafb5f0c6044a8efbf152321 (diff) | |
| parent | 8aef0015fd8903b92cf0aab8a98ee669ec97b5ef (diff) | |
Merge pull request #10518 from iwubcode/draw-mod
Introducing a 'GraphicsMod' system for creators
Diffstat (limited to 'Source/Core/VideoCommon/VertexShaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexShaderManager.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp index 6a7636d587..680d1ad3ee 100644 --- a/Source/Core/VideoCommon/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/VertexShaderManager.cpp @@ -85,7 +85,7 @@ void VertexShaderManager::Dirty() // Syncs the shader constant buffers with xfmem // TODO: A cleaner way to control the matrices without making a mess in the parameters field -void VertexShaderManager::SetConstants() +void VertexShaderManager::SetConstants(const std::vector<std::string>& textures) { if (constants.missing_color_hex != g_ActiveConfig.iMissingColorValue) { @@ -302,7 +302,27 @@ void VertexShaderManager::SetConstants() g_stats.AddScissorRect(); } - if (bProjectionChanged || g_freelook_camera.GetController()->IsDirty()) + std::vector<GraphicsModAction*> projection_actions; + if (g_ActiveConfig.bGraphicMods) + { + for (const auto action : + g_renderer->GetGraphicsModManager().GetProjectionActions(xfmem.projection.type)) + { + projection_actions.push_back(action); + } + + for (const auto& texture : textures) + { + for (const auto action : g_renderer->GetGraphicsModManager().GetProjectionTextureActions( + xfmem.projection.type, texture)) + { + projection_actions.push_back(action); + } + } + } + + if (bProjectionChanged || g_freelook_camera.GetController()->IsDirty() || + !projection_actions.empty()) { bProjectionChanged = false; @@ -384,6 +404,11 @@ void VertexShaderManager::SetConstants() if (g_freelook_camera.IsActive() && xfmem.projection.type == ProjectionType::Perspective) corrected_matrix *= g_freelook_camera.GetView(); + for (auto action : projection_actions) + { + action->OnProjection(&corrected_matrix); + } + memcpy(constants.projection.data(), corrected_matrix.data.data(), 4 * sizeof(float4)); g_freelook_camera.GetController()->SetClean(); |
