From 35bb9239cae38a173204cfc36bdfa22aec88fb00 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Thu, 2 Jan 2020 22:31:04 -0300 Subject: gl_rasterizer: Notify depth mask changes on clear --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 2 +- src/video_core/renderer_opengl/gl_state_tracker.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index dabb22ae8..c8aa342ef 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -435,7 +435,7 @@ void RasterizerOpenGL::Clear() { ASSERT_MSG(regs.zeta_enable != 0, "Tried to clear Z but buffer is not enabled!"); use_depth = true; - // TODO: Signal state tracker about these changes + state_tracker.NotifyDepthMask(); glDepthMask(GL_TRUE); } if (regs.clear_buffers.S) { diff --git a/src/video_core/renderer_opengl/gl_state_tracker.h b/src/video_core/renderer_opengl/gl_state_tracker.h index 992b915fb..a390e0b99 100644 --- a/src/video_core/renderer_opengl/gl_state_tracker.h +++ b/src/video_core/renderer_opengl/gl_state_tracker.h @@ -149,6 +149,11 @@ public: flags[OpenGL::Dirty::CullTest] = true; } + void NotifyDepthMask() { + auto& flags = system.GPU().Maxwell3D().dirty.flags; + flags[OpenGL::Dirty::DepthMask] = true; + } + void NotifyDepthTest() { auto& flags = system.GPU().Maxwell3D().dirty.flags; flags[OpenGL::Dirty::DepthTest] = true; -- cgit v1.2.3