diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index 49e23be700..573265179d 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -442,7 +442,7 @@ void GSDeviceOGL::DrawIndexedPrimitive(int offset, int count) void GSDeviceOGL::ClearRenderTarget(GSTexture* t, const GSVector4& c) { GSTextureOGL* T = static_cast(t); - if (T->HasBeenCleaned()) + if (T->HasBeenCleaned() && !T->IsBackbuffer()) return; GL_PUSH(format("Clear RT %d", T->GetID()).c_str()); @@ -464,12 +464,15 @@ void GSDeviceOGL::ClearRenderTarget(GSTexture* t, const GSVector4& c) OMAttachRt(T); gl_ClearBufferfv(GL_COLOR, 0, c.v); + } OMSetColorMaskState(OMColorMaskSelector(old_color_mask)); glEnable(GL_SCISSOR_TEST); + T->WasCleaned(); + GL_POP(); } diff --git a/plugins/GSdx/GSTextureOGL.cpp b/plugins/GSdx/GSTextureOGL.cpp index 8746370a95..2e750fd0fb 100644 --- a/plugins/GSdx/GSTextureOGL.cpp +++ b/plugins/GSdx/GSTextureOGL.cpp @@ -258,12 +258,6 @@ void GSTextureOGL::Invalidate() } } -bool GSTextureOGL::HasBeenCleaned() { - bool old = m_clean; - m_clean = true; - return old; -} - bool GSTextureOGL::Update(const GSVector4i& r, const void* data, int pitch) { ASSERT(m_type != GSTexture::DepthStencil && m_type != GSTexture::Offscreen); diff --git a/plugins/GSdx/GSTextureOGL.h b/plugins/GSdx/GSTextureOGL.h index 19794d99b5..ab5786b07a 100644 --- a/plugins/GSdx/GSTextureOGL.h +++ b/plugins/GSdx/GSTextureOGL.h @@ -79,6 +79,7 @@ class GSTextureOGL : public GSTexture uint32 GetID() { return m_texture_id; } GLuint64 GetHandle(GLuint sampler_id); - bool HasBeenCleaned(); + bool HasBeenCleaned() { return m_clean; } void WasAttached() { m_clean = false; m_dirty = true; } + void WasCleaned() { m_clean = true; } };