From 38479dd7830ab0790b487cbdee7477e6eb6b941d Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 21 Jan 2018 01:32:20 +1000 Subject: [PATCH] RenderBase: Force a pipeline flush when drawing the XFB to the host Since we use the common pipelines here and draw vertices if a batch is currently being built by the vertex loader, we end up trampling over its pointer, as we share the buffer with the loader, and it has not been unmapped yet. Force a pipeline flush to avoid this. --- Source/Core/VideoCommon/RenderBase.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 2e42ed984a..d37b6aa07b 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -697,6 +697,11 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const m_last_xfb_region = xfb_rect; + // Since we use the common pipelines here and draw vertices if a batch is currently being + // built by the vertex loader, we end up trampling over its pointer, as we share the buffer + // with the loader, and it has not been unmapped yet. Force a pipeline flush to avoid this. + g_vertex_manager->Flush(); + // TODO: merge more generic parts into VideoCommon { std::lock_guard guard(m_swap_mutex);