OpenGLDevice: Keep scissor active on present clear

And disable depth test if set to always (match DX11).
This commit is contained in:
Stenzek 2023-09-23 13:11:25 +10:00
parent aa1e59c9f1
commit 8dc9c225d7
2 changed files with 5 additions and 5 deletions

View file

@ -663,10 +663,6 @@ bool OpenGLDevice::BeginPresent(bool skip_present)
}
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glDisable(GL_SCISSOR_TEST);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
glEnable(GL_SCISSOR_TEST);
const Common::Rectangle<s32> window_rc =
Common::Rectangle<s32>::FromExtents(0, 0, m_window_info.surface_width, m_window_info.surface_height);
@ -675,6 +671,9 @@ bool OpenGLDevice::BeginPresent(bool skip_present)
m_last_scissor = window_rc;
UpdateViewport();
UpdateScissor();
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
return true;
}

View file

@ -612,7 +612,8 @@ ALWAYS_INLINE static void ApplyDepthState(const GPUPipeline::DepthState& ds)
GL_EQUAL, // Equal
}};
(ds.depth_test != GPUPipeline::DepthFunc::Never) ? glEnable(GL_DEPTH_TEST) : glDisable(GL_DEPTH_TEST);
(ds.depth_test != GPUPipeline::DepthFunc::Always || ds.depth_write) ? glEnable(GL_DEPTH_TEST) :
glDisable(GL_DEPTH_TEST);
glDepthFunc(func_mapping[static_cast<u8>(ds.depth_test.GetValue())]);
glDepthMask(ds.depth_write);
}