summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp11
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index b80f4336d..0d0e0653d 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -304,6 +304,9 @@ void RasterizerOpenGL::DrawArrays() {
304 MICROPROFILE_SCOPE(OpenGL_Drawing); 304 MICROPROFILE_SCOPE(OpenGL_Drawing);
305 const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs; 305 const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs;
306 306
307 // Sync the depth test state before configuring the framebuffer surfaces.
308 SyncDepthTestState();
309
307 // TODO(bunnei): Implement these 310 // TODO(bunnei): Implement these
308 const bool has_stencil = false; 311 const bool has_stencil = false;
309 const bool using_color_fb = true; 312 const bool using_color_fb = true;
@@ -719,6 +722,14 @@ void RasterizerOpenGL::SyncDepthOffset() {
719 UNREACHABLE(); 722 UNREACHABLE();
720} 723}
721 724
725void RasterizerOpenGL::SyncDepthTestState() {
726 const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs;
727
728 state.depth.test_enabled = regs.depth_test_enable != 0;
729 state.depth.write_mask = regs.depth_write_enabled ? GL_TRUE : GL_FALSE;
730 state.depth.test_func = MaxwellToGL::ComparisonOp(regs.depth_test_func);
731}
732
722void RasterizerOpenGL::SyncBlendState() { 733void RasterizerOpenGL::SyncBlendState() {
723 const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs; 734 const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs;
724 735
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index 621200f03..493aa39e5 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -126,6 +126,9 @@ private:
126 /// Syncs the depth offset to match the guest state 126 /// Syncs the depth offset to match the guest state
127 void SyncDepthOffset(); 127 void SyncDepthOffset();
128 128
129 /// Syncs the depth test state to match the guest state
130 void SyncDepthTestState();
131
129 /// Syncs the blend state to match the guest state 132 /// Syncs the blend state to match the guest state
130 void SyncBlendState(); 133 void SyncBlendState();
131 134