summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/RenderBase.cpp
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2017-08-12 19:51:33 -0500
committeriwubcode <iwubcode@users.noreply.github.com>2017-11-17 22:11:30 -0600
commite33ab4117d68aae9a7406ca4738e9c429200bf17 (patch)
tree7faed196d02f15a7978b2f64d88cac691cce2c61 /Source/Core/VideoCommon/RenderBase.cpp
parent76b775d5be1f9228c648b8edc1f7bb9533acb471 (diff)
Video Common: Make auto IR work with HybridXFB
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index 4bc8911b08..d0bebe363c 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -150,8 +150,8 @@ bool Renderer::CalculateTargetSize()
if (g_ActiveConfig.iEFBScale == EFB_SCALE_AUTO_INTEGRAL)
{
// Set a scale based on the window size
- int width = FramebufferManagerBase::ScaleToVirtualXfbWidth(EFB_WIDTH, m_target_rectangle);
- int height = FramebufferManagerBase::ScaleToVirtualXfbHeight(EFB_HEIGHT, m_target_rectangle);
+ int width = EFB_WIDTH * m_target_rectangle.GetWidth() / m_last_xfb_width;
+ int height = EFB_HEIGHT * m_target_rectangle.GetWidth() / m_last_xfb_height;
m_efb_scale = std::max((width - 1) / EFB_WIDTH + 1, (height - 1) / EFB_HEIGHT + 1);
}
else
@@ -652,6 +652,10 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const
m_fps_counter.Update();
update_frame_count = true;
}
+
+ // Update our last xfb values
+ m_last_xfb_width = (fbStride < 1 || fbStride > MAX_XFB_WIDTH) ? MAX_XFB_WIDTH : fbStride;
+ m_last_xfb_height = (fbHeight < 1 || fbHeight > MAX_XFB_HEIGHT) ? MAX_XFB_HEIGHT : fbHeight;
}
frameCount++;