OpenGLDevice: Set glColorMask() on clear

Adreno doesn't appear to clear all channels otherwise.
This commit is contained in:
Stenzek
2023-12-03 21:36:11 +10:00
parent 2bdc691111
commit 60b91a1cdb
2 changed files with 12 additions and 0 deletions

View File

@ -492,7 +492,10 @@ void OpenGLDevice::CommitClear(OpenGLTexture* tex)
{
const auto color = tex->GetUNormClearColor();
glDisable(GL_SCISSOR_TEST);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glClearBufferfv(GL_COLOR, 0, color.data());
glColorMask(m_last_blend_state.write_r, m_last_blend_state.write_g, m_last_blend_state.write_b,
m_last_blend_state.write_a);
glEnable(GL_SCISSOR_TEST);
}
@ -531,7 +534,10 @@ void OpenGLDevice::CommitClear(OpenGLFramebuffer* fb)
{
const auto color = FB->GetUNormClearColor();
glDisable(GL_SCISSOR_TEST);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glClearBufferfv(GL_COLOR, 0, color.data());
glColorMask(m_last_blend_state.write_r, m_last_blend_state.write_g, m_last_blend_state.write_b,
m_last_blend_state.write_a);
glEnable(GL_SCISSOR_TEST);
FB->SetState(GPUTexture::State::Dirty);
}