summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2017-11-03 16:04:46 +0100
committerJosJuice <josjuice@gmail.com>2017-11-03 16:04:46 +0100
commita310cbec8e7dfa18b22d53dc45a47757a97c827d (patch)
tree4ab0aed494e7eab6ef6c4287d06404fa9e720cd5 /Source/Core/VideoCommon
parentc8710d0861fb991d860955a221c02507b55cdd2d (diff)
Fix incorrect handling of auto IR
Some lines of code in Dolphin just plainly grabbed the value of g_ActiveConfig.iEFBScale, which resulted in Auto being treated as 0x rather than the actual automatically selected scale.
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp5
-rw-r--r--Source/Core/VideoCommon/RenderBase.h2
-rw-r--r--Source/Core/VideoCommon/VertexManagerBase.cpp2
3 files changed, 8 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index 2741e14d09..63e3f5f5ed 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -131,6 +131,11 @@ void Renderer::RenderToXFB(u32 xfbAddr, const EFBRectangle& sourceRc, u32 fbStri
}
}
+unsigned int Renderer::GetEFBScale() const
+{
+ return m_efb_scale;
+}
+
int Renderer::EFBToScaledX(int x) const
{
return x * static_cast<int>(m_efb_scale);
diff --git a/Source/Core/VideoCommon/RenderBase.h b/Source/Core/VideoCommon/RenderBase.h
index 1c6bc44171..30f16c35a0 100644
--- a/Source/Core/VideoCommon/RenderBase.h
+++ b/Source/Core/VideoCommon/RenderBase.h
@@ -101,6 +101,8 @@ public:
std::tuple<TargetRectangle, TargetRectangle>
ConvertStereoRectangle(const TargetRectangle& rc) const;
+ unsigned int GetEFBScale() const;
+
// Use this to upscale native EFB coordinates to IDEAL internal resolution
int EFBToScaledX(int x) const;
int EFBToScaledY(int y) const;
diff --git a/Source/Core/VideoCommon/VertexManagerBase.cpp b/Source/Core/VideoCommon/VertexManagerBase.cpp
index 870b9ad1e2..f06eb9b31a 100644
--- a/Source/Core/VideoCommon/VertexManagerBase.cpp
+++ b/Source/Core/VideoCommon/VertexManagerBase.cpp
@@ -258,7 +258,7 @@ static void SetSamplerState(u32 index, bool custom_tex, bool has_arbitrary_mips)
// that have arbitrary contents, eg. are used for fog effects where the
// distance they kick in at is important to preserve at any resolution.
state.lod_bias =
- state.lod_bias + std::log2(static_cast<float>(g_ActiveConfig.iEFBScale)) * 256.f;
+ state.lod_bias + std::log2(static_cast<float>(g_renderer->GetEFBScale())) * 256.f;
// Anisotropic also pushes mips farther away so it cannot be used either
state.anisotropic_filtering = 0;