summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2017-03-04 16:42:27 +1000
committerStenzek <stenzek@gmail.com>2017-03-04 16:53:07 +1000
commit00a0a91513fbb52362fc7d3a7db6450d66c4c68a (patch)
tree97bf343b0e727fbac461389c4e6d5612324cfc9b /Source/Core/VideoCommon
parentafc25fdca07cc1cc80e05cd753027f1cd40328db (diff)
VideoCommon: Move last EFB scale handling to CalculateTargetSize
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/PixelShaderManager.cpp8
-rw-r--r--Source/Core/VideoCommon/PixelShaderManager.h2
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp8
-rw-r--r--Source/Core/VideoCommon/RenderBase.h4
4 files changed, 8 insertions, 14 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp
index c9e102ab5b..c5a23a22c7 100644
--- a/Source/Core/VideoCommon/PixelShaderManager.cpp
+++ b/Source/Core/VideoCommon/PixelShaderManager.cpp
@@ -49,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;
@@ -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 / g_renderer->EFBToScaledXf(1);
- constants.efbscale[1] = 1.0f / g_renderer->EFBToScaledYf(1);
+ constants.efbscale[0] = 1.0f / scalex;
+ constants.efbscale[1] = 1.0f / scaley;
dirty = true;
}
diff --git a/Source/Core/VideoCommon/PixelShaderManager.h b/Source/Core/VideoCommon/PixelShaderManager.h
index fe57fd4655..c7d6e3b9ee 100644
--- a/Source/Core/VideoCommon/PixelShaderManager.h
+++ b/Source/Core/VideoCommon/PixelShaderManager.h
@@ -29,7 +29,7 @@ public:
static void SetTexDims(int texmapid, u32 width, u32 height);
static void SetZTextureBias();
static void SetViewportChanged();
- static void SetEfbScaleChanged();
+ static void SetEfbScaleChanged(float scalex, float scaley);
static void SetZSlope(float dfdx, float dfdy, float f0);
static void SetIndMatrixChanged(int matrixidx);
static void SetZTextureTypeChanged();
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index fc93f45896..784a294785 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -166,6 +166,8 @@ bool Renderer::CalculateTargetSize()
int newEFBWidth, newEFBHeight;
newEFBWidth = newEFBHeight = 0;
+ m_last_efb_scale = g_ActiveConfig.iEFBScale;
+
// TODO: Ugly. Clean up
switch (m_last_efb_scale)
{
@@ -231,6 +233,7 @@ bool Renderer::CalculateTargetSize()
{
m_target_width = newEFBWidth;
m_target_height = newEFBHeight;
+ PixelShaderManager::SetEfbScaleChanged(EFBToScaledXf(1), EFBToScaledYf(1));
return true;
}
return false;
@@ -614,11 +617,6 @@ void Renderer::UpdateDrawRectangle()
m_target_rectangle.bottom = YOffset + iHeight;
}
-void Renderer::InitializeCommon()
-{
- PixelShaderManager::SetEfbScaleChanged();
-}
-
void Renderer::SetWindowSize(int width, int height)
{
if (width < 1)
diff --git a/Source/Core/VideoCommon/RenderBase.h b/Source/Core/VideoCommon/RenderBase.h
index 92ebade7db..3afa8761d4 100644
--- a/Source/Core/VideoCommon/RenderBase.h
+++ b/Source/Core/VideoCommon/RenderBase.h
@@ -79,10 +79,6 @@ public:
virtual void RestoreState() {}
virtual void ResetAPIState() {}
virtual void RestoreAPIState() {}
- // Some of the methods called by here assume g_renderer is initialized, therefore
- // we must call it after constructing the backend's Renderer instance.
- void InitializeCommon();
-
// Ideal internal resolution - determined by display resolution (automatic scaling) and/or a
// multiple of the native EFB resolution
int GetTargetWidth() { return m_target_width; }