diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2017-08-20 14:24:37 -0500 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2017-11-17 22:11:31 -0600 |
| commit | e6d85b0915681a3f8162d45468f2c488d6df8114 (patch) | |
| tree | 82ca032aa84b209eeb6473c08537dda25708e0b6 /Source/Core/VideoCommon/RenderBase.cpp | |
| parent | c58010404df570edffd948302e8bfe6c539c698d (diff) | |
Video Common: Avoid 'presenting' duplicate frames by detecting when swap
hasn't changed since the last frame
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/RenderBase.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 67721caabc..00bb5d24fc 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -639,11 +639,10 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const auto* xfb_entry = g_texture_cache->GetTexture(xfbAddr, fbWidth, fbHeight, TextureFormat::XFB, force_safe_texture_cache_hash); - if (xfb_entry) + if (xfb_entry && xfb_entry->id != m_last_xfb_id) { - // TODO, check if xfb_entry is a duplicate of the previous frame and skip SwapImpl - m_last_xfb_texture = xfb_entry->texture.get(); + m_last_xfb_id = xfb_entry->id; // TODO: merge more generic parts into VideoCommon g_renderer->SwapImpl(xfb_entry->texture.get(), rc, ticks, xfb_entry->gamma); |
