Prechádzať zdrojové kódy

Merge pull request #3560 from ReinUsesLisp/fix-stencil

gl_rasterizer: Synchronize stencil testing on clears
bunnei 6 rokov pred
rodič
commit
4c72190a06

+ 2 - 5
src/video_core/renderer_opengl/gl_rasterizer.cpp

@@ -444,6 +444,7 @@ void RasterizerOpenGL::Clear() {
     }
     }
 
 
     SyncRasterizeEnable();
     SyncRasterizeEnable();
+    SyncStencilTestState();
 
 
     if (regs.clear_flags.scissor) {
     if (regs.clear_flags.scissor) {
         SyncScissorTest();
         SyncScissorTest();
@@ -1052,12 +1053,8 @@ void RasterizerOpenGL::SyncStencilTestState() {
     flags[Dirty::StencilTest] = false;
     flags[Dirty::StencilTest] = false;
 
 
     const auto& regs = gpu.regs;
     const auto& regs = gpu.regs;
-    if (!regs.stencil_enable) {
-        glDisable(GL_STENCIL_TEST);
-        return;
-    }
+    oglEnable(GL_STENCIL_TEST, regs.stencil_enable);
 
 
-    glEnable(GL_STENCIL_TEST);
     glStencilFuncSeparate(GL_FRONT, MaxwellToGL::ComparisonOp(regs.stencil_front_func_func),
     glStencilFuncSeparate(GL_FRONT, MaxwellToGL::ComparisonOp(regs.stencil_front_func_func),
                           regs.stencil_front_func_ref, regs.stencil_front_func_mask);
                           regs.stencil_front_func_ref, regs.stencil_front_func_mask);
     glStencilOpSeparate(GL_FRONT, MaxwellToGL::StencilOp(regs.stencil_front_op_fail),
     glStencilOpSeparate(GL_FRONT, MaxwellToGL::StencilOp(regs.stencil_front_op_fail),