mirror of https://github.com/PCSX2/pcsx2.git
gsdx-ogl: really avoid consecutive clean
This commit is contained in:
parent
84c3592fbe
commit
a5e424512c
|
@ -442,7 +442,7 @@ void GSDeviceOGL::DrawIndexedPrimitive(int offset, int count)
|
||||||
void GSDeviceOGL::ClearRenderTarget(GSTexture* t, const GSVector4& c)
|
void GSDeviceOGL::ClearRenderTarget(GSTexture* t, const GSVector4& c)
|
||||||
{
|
{
|
||||||
GSTextureOGL* T = static_cast<GSTextureOGL*>(t);
|
GSTextureOGL* T = static_cast<GSTextureOGL*>(t);
|
||||||
if (T->HasBeenCleaned())
|
if (T->HasBeenCleaned() && !T->IsBackbuffer())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GL_PUSH(format("Clear RT %d", T->GetID()).c_str());
|
GL_PUSH(format("Clear RT %d", T->GetID()).c_str());
|
||||||
|
@ -464,12 +464,15 @@ void GSDeviceOGL::ClearRenderTarget(GSTexture* t, const GSVector4& c)
|
||||||
OMAttachRt(T);
|
OMAttachRt(T);
|
||||||
|
|
||||||
gl_ClearBufferfv(GL_COLOR, 0, c.v);
|
gl_ClearBufferfv(GL_COLOR, 0, c.v);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OMSetColorMaskState(OMColorMaskSelector(old_color_mask));
|
OMSetColorMaskState(OMColorMaskSelector(old_color_mask));
|
||||||
|
|
||||||
glEnable(GL_SCISSOR_TEST);
|
glEnable(GL_SCISSOR_TEST);
|
||||||
|
|
||||||
|
T->WasCleaned();
|
||||||
|
|
||||||
GL_POP();
|
GL_POP();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)
|
bool GSTextureOGL::Update(const GSVector4i& r, const void* data, int pitch)
|
||||||
{
|
{
|
||||||
ASSERT(m_type != GSTexture::DepthStencil && m_type != GSTexture::Offscreen);
|
ASSERT(m_type != GSTexture::DepthStencil && m_type != GSTexture::Offscreen);
|
||||||
|
|
|
@ -79,6 +79,7 @@ class GSTextureOGL : public GSTexture
|
||||||
|
|
||||||
uint32 GetID() { return m_texture_id; }
|
uint32 GetID() { return m_texture_id; }
|
||||||
GLuint64 GetHandle(GLuint sampler_id);
|
GLuint64 GetHandle(GLuint sampler_id);
|
||||||
bool HasBeenCleaned();
|
bool HasBeenCleaned() { return m_clean; }
|
||||||
void WasAttached() { m_clean = false; m_dirty = true; }
|
void WasAttached() { m_clean = false; m_dirty = true; }
|
||||||
|
void WasCleaned() { m_clean = true; }
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue