mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-25 07:05:40 +00:00
OpenGLDevice: Keep scissor active on present clear
And disable depth test if set to always (match DX11).
This commit is contained in:
parent
aa1e59c9f1
commit
8dc9c225d7
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue