aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl/gl_rasterizer.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-07-14 15:00:37 -0400
committerFernandoS27 <fsahmkow27@gmail.com>2019-07-17 17:29:54 -0400
commit8cdbfe69b1211431536414e375f0fd49222d9a29 (patch)
treedac0320358b55acc6a431c07e38d7da4fb156ec2 /src/video_core/renderer_opengl/gl_rasterizer.cpp
parent0ff4a5fa3918c5a1aa9d973061354bf21d7205d8 (diff)
GL_Rasterizer: Corrections to Clearing.
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 4aa3d6548..77195ad93 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -604,7 +604,8 @@ void RasterizerOpenGL::Clear() {
prev_state.Apply();
});
- OpenGLState clear_state;
+ OpenGLState clear_state{OpenGLState::GetCurState()};
+ clear_state.DefaultViewports();
if (regs.clear_buffers.R || regs.clear_buffers.G || regs.clear_buffers.B ||
regs.clear_buffers.A) {
use_color = true;
@@ -624,6 +625,7 @@ void RasterizerOpenGL::Clear() {
// true.
clear_state.depth.test_enabled = true;
clear_state.depth.test_func = GL_ALWAYS;
+ clear_state.depth.write_mask = GL_TRUE;
}
if (regs.clear_buffers.S) {
ASSERT_MSG(regs.zeta_enable != 0, "Tried to clear stencil but buffer is not enabled!");
@@ -661,6 +663,7 @@ void RasterizerOpenGL::Clear() {
}
ConfigureClearFramebuffer(clear_state, use_color, use_depth, use_stencil);
+
SyncViewport(clear_state);
if (regs.clear_flags.scissor) {
SyncScissorTest(clear_state);
@@ -670,11 +673,8 @@ void RasterizerOpenGL::Clear() {
clear_state.EmulateViewportWithScissor();
}
- clear_state.ApplyColorMask();
- clear_state.ApplyDepth();
- clear_state.ApplyStencilTest();
- clear_state.ApplyViewport();
- clear_state.ApplyFramebufferState();
+ clear_state.AllDirty();
+ clear_state.Apply();
if (use_color) {
glClearBufferfv(GL_COLOR, 0, regs.clear_color);