diff --git a/src/util/opengl_device.cpp b/src/util/opengl_device.cpp index 9fac10bbd..78dbf2bf1 100644 --- a/src/util/opengl_device.cpp +++ b/src/util/opengl_device.cpp @@ -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 window_rc = Common::Rectangle::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; } diff --git a/src/util/opengl_pipeline.cpp b/src/util/opengl_pipeline.cpp index 040a1ea2e..c614557c1 100644 --- a/src/util/opengl_pipeline.cpp +++ b/src/util/opengl_pipeline.cpp @@ -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(ds.depth_test.GetValue())]); glDepthMask(ds.depth_write); }