summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexShaderManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/VertexShaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexShaderManager.cpp29
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();