gsdx-ogl: really avoid consecutive clean

This commit is contained in:
Gregory Hainaut 2015-05-15 15:24:43 +02:00
parent 84c3592fbe
commit a5e424512c
3 changed files with 6 additions and 8 deletions

View File

@ -442,7 +442,7 @@ void GSDeviceOGL::DrawIndexedPrimitive(int offset, int count)
void GSDeviceOGL::ClearRenderTarget(GSTexture* t, const GSVector4& c)
{
GSTextureOGL* T = static_cast<GSTextureOGL*>(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();
}

View File

@ -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);

View File

@ -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; }
};