summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/RenderBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index 2e42ed984a..ba60e1636c 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -78,8 +78,10 @@ static float AspectToWidescreen(float aspect)
return aspect * ((16.0f / 9.0f) / (4.0f / 3.0f));
}
-Renderer::Renderer(int backbuffer_width, int backbuffer_height)
- : m_backbuffer_width(backbuffer_width), m_backbuffer_height(backbuffer_height)
+Renderer::Renderer(int backbuffer_width, int backbuffer_height,
+ AbstractTextureFormat backbuffer_format)
+ : m_backbuffer_width(backbuffer_width), m_backbuffer_height(backbuffer_height),
+ m_backbuffer_format(backbuffer_format)
{
UpdateActiveConfig();
UpdateDrawRectangle();
@@ -93,6 +95,11 @@ Renderer::Renderer(int backbuffer_width, int backbuffer_height)
Renderer::~Renderer() = default;
+bool Renderer::Initialize()
+{
+ return true;
+}
+
void Renderer::Shutdown()
{
// First stop any framedumping, which might need to dump the last xfb frame. This process
@@ -697,6 +704,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<std::mutex> guard(m_swap_mutex);