From 2a2a0227923b6fde9d5a7c6fb6eb56429f4e79d4 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Wed, 8 Feb 2017 19:11:02 +0100 Subject: [PATCH] gsdx ogl: add a texture barrier when target is read back Fix graphical corruption in Nouveau/BUA/devil may cry Issue #1805 --- plugins/GSdx/GSDeviceOGL.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index 978076fc8b..e3337a523f 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -1202,6 +1202,10 @@ GSTexture* GSDeviceOGL::CopyOffscreen(GSTexture* src, const GSVector4& sRect, in GSVector4 dRect(0, 0, w, h); + // StretchRect will read an old target. However, the memory cache might contains + // invalid data (for example due to SW blending). + glTextureBarrier(); + StretchRect(src, sRect, dst, dRect, m_convert.ps[ps_shader]); return dst;