mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-03-06 14:27:44 +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);
|
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 =
|
const Common::Rectangle<s32> window_rc =
|
||||||
Common::Rectangle<s32>::FromExtents(0, 0, m_window_info.surface_width, m_window_info.surface_height);
|
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;
|
m_last_scissor = window_rc;
|
||||||
UpdateViewport();
|
UpdateViewport();
|
||||||
UpdateScissor();
|
UpdateScissor();
|
||||||
|
|
||||||
|
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -612,7 +612,8 @@ ALWAYS_INLINE static void ApplyDepthState(const GPUPipeline::DepthState& ds)
|
||||||
GL_EQUAL, // Equal
|
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())]);
|
glDepthFunc(func_mapping[static_cast<u8>(ds.depth_test.GetValue())]);
|
||||||
glDepthMask(ds.depth_write);
|
glDepthMask(ds.depth_write);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue