summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PixelShaderManager.cpp
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2017-03-08 11:02:20 +0100
committerGitHub <noreply@github.com>2017-03-08 11:02:20 +0100
commit489d90b6f34bb526a2588545bc53d7a41531de9a (patch)
treeaba079785ffd67ec478bd23ad7a7a3198eb06b9a /Source/Core/VideoCommon/PixelShaderManager.cpp
parent9c1eac1f4f8231ee024fa9c3679e89f768dafa99 (diff)
parent459a5ab554af24c8e2c1978d02444bac5aa85e3f (diff)
Merge pull request #4999 from stenzek/renderer-statics
VideoCommon: Eliminate static state in Renderer
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/PixelShaderManager.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp
index f029751363..c5a23a22c7 100644
--- a/Source/Core/VideoCommon/PixelShaderManager.cpp
+++ b/Source/Core/VideoCommon/PixelShaderManager.cpp
@@ -27,7 +27,6 @@ void PixelShaderManager::Init()
s_bFogRangeAdjustChanged = true;
s_bViewPortChanged = false;
- SetEfbScaleChanged();
SetIndMatrixChanged(0);
SetIndMatrixChanged(1);
SetIndMatrixChanged(2);
@@ -50,7 +49,7 @@ void PixelShaderManager::Dirty()
// Any constants that can changed based on settings should be re-calculated
s_bFogRangeAdjustChanged = true;
- SetEfbScaleChanged();
+ SetEfbScaleChanged(g_renderer->EFBToScaledXf(1), g_renderer->EFBToScaledYf(1));
SetFogParamChanged();
dirty = true;
@@ -78,7 +77,8 @@ void PixelShaderManager::SetConstants()
// so to simplify I use the hi coefficient as K in the shader taking 256 as the scale
// TODO: Shouldn't this be EFBToScaledXf?
constants.fogf[0][0] = ScreenSpaceCenter;
- constants.fogf[0][1] = (float)Renderer::EFBToScaledX((int)(2.0f * xfmem.viewport.wd));
+ constants.fogf[0][1] =
+ static_cast<float>(g_renderer->EFBToScaledX(static_cast<int>(2.0f * xfmem.viewport.wd)));
constants.fogf[0][2] = bpmem.fogRange.K[4].HI / 256.0f;
}
else
@@ -159,10 +159,10 @@ void PixelShaderManager::SetViewportChanged()
true; // TODO: Shouldn't be necessary with an accurate fog range adjust implementation
}
-void PixelShaderManager::SetEfbScaleChanged()
+void PixelShaderManager::SetEfbScaleChanged(float scalex, float scaley)
{
- constants.efbscale[0] = 1.0f / Renderer::EFBToScaledXf(1);
- constants.efbscale[1] = 1.0f / Renderer::EFBToScaledYf(1);
+ constants.efbscale[0] = 1.0f / scalex;
+ constants.efbscale[1] = 1.0f / scaley;
dirty = true;
}