diff options
| author | Rodolfo Bogado <rodolfoosvaldobogado@gmail.com> | 2018-11-07 00:27:12 -0300 |
|---|---|---|
| committer | Rodolfo Bogado <rodolfoosvaldobogado@gmail.com> | 2018-11-11 16:31:00 -0300 |
| commit | 4a6eff3b7b0cf8578ac8e23fe47dae52c7fb350a (patch) | |
| tree | 6c562c3140257de2d510ab67aff43f02af11c7a0 /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
| parent | e9610ec0dd3d47ae7dc2b14932faef0318d36125 (diff) | |
Try to fix problems with stencil test in some games, relax translation to opengl enums to avoid crashing and only generate logs of the errors.
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 40f474e07..8dd7bd514 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -996,9 +996,6 @@ void RasterizerOpenGL::SyncStencilTestState() { return; } - // TODO(bunnei): Verify behavior when this is not set - ASSERT(regs.stencil_two_side_enable); - state.stencil.front.test_func = MaxwellToGL::ComparisonOp(regs.stencil_front_func_func); state.stencil.front.test_ref = regs.stencil_front_func_ref; state.stencil.front.test_mask = regs.stencil_front_func_mask; @@ -1006,7 +1003,7 @@ void RasterizerOpenGL::SyncStencilTestState() { state.stencil.front.action_depth_fail = MaxwellToGL::StencilOp(regs.stencil_front_op_zfail); state.stencil.front.action_depth_pass = MaxwellToGL::StencilOp(regs.stencil_front_op_zpass); state.stencil.front.write_mask = regs.stencil_front_mask; - + if (regs.stencil_two_side_enable) { state.stencil.back.test_func = MaxwellToGL::ComparisonOp(regs.stencil_back_func_func); state.stencil.back.test_ref = regs.stencil_back_func_ref; state.stencil.back.test_mask = regs.stencil_back_func_mask; @@ -1014,6 +1011,15 @@ void RasterizerOpenGL::SyncStencilTestState() { state.stencil.back.action_depth_fail = MaxwellToGL::StencilOp(regs.stencil_back_op_zfail); state.stencil.back.action_depth_pass = MaxwellToGL::StencilOp(regs.stencil_back_op_zpass); state.stencil.back.write_mask = regs.stencil_back_mask; + } else { + state.stencil.back.test_func = GL_ALWAYS; + state.stencil.back.test_ref = 0; + state.stencil.back.test_mask = 0xFFFFFFFF; + state.stencil.back.write_mask = 0xFFFFFFFF; + state.stencil.back.action_stencil_fail = GL_KEEP; + state.stencil.back.action_depth_fail = GL_KEEP; + state.stencil.back.action_depth_pass = GL_KEEP; + } } void RasterizerOpenGL::SyncColorMask() { |
