Module: Mesa
Branch: softpipe-opt
Commit: fe9ca0f718cbc467e5cee99a2c20a5f257ed2fe1
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fe9ca0f718cbc467e5cee99a2c20a5f257ed2fe1

Author: Keith Whitwell <[email protected]>
Date:   Tue Sep 22 20:47:37 2009 +0100

softpipe: need to write depth/stencil values even when stencil fails

---

 src/gallium/drivers/softpipe/sp_quad_depth_test.c |   22 +++++++++-----------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c 
b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
index ce1bab9..0ca86c4 100644
--- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c
+++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
@@ -498,7 +498,7 @@ depth_test_quad(struct quad_stage *qs,
  * Do stencil (and depth) testing.  Stenciling depends on the outcome of
  * depth testing.
  */
-static boolean
+static void
 depth_stencil_test_quad(struct quad_stage *qs, 
                         struct depth_data *data,
                         struct quad_header *quad)
@@ -545,13 +545,13 @@ depth_stencil_test_quad(struct quad_stage *qs,
 
          /* update stencil buffer values according to z pass/fail result */
          if (zFailOp != PIPE_STENCIL_OP_KEEP) {
-            const unsigned failMask = origMask & ~quad->inout.mask;
-            apply_stencil_op(data, failMask, zFailOp, ref, wrtMask);
+            const unsigned zFailMask = origMask & ~quad->inout.mask;
+            apply_stencil_op(data, zFailMask, zFailOp, ref, wrtMask);
          }
 
          if (zPassOp != PIPE_STENCIL_OP_KEEP) {
-            const unsigned passMask = origMask & quad->inout.mask;
-            apply_stencil_op(data, passMask, zPassOp, ref, wrtMask);
+            const unsigned zPassMask = origMask & quad->inout.mask;
+            apply_stencil_op(data, zPassMask, zPassOp, ref, wrtMask);
          }
       }
       else {
@@ -559,8 +559,6 @@ depth_stencil_test_quad(struct quad_stage *qs,
          apply_stencil_op(data, quad->inout.mask, zPassOp, ref, wrtMask);
       }
    }
-
-   return quad->inout.mask != 0;
 }
 
 
@@ -689,17 +687,17 @@ depth_test_quads_fallback(struct quad_stage *qs,
          }
 
          if (qs->softpipe->depth_stencil->stencil[0].enabled) {
-            if (!depth_stencil_test_quad(qs, &data, quads[i]))
-               continue;
+            depth_stencil_test_quad(qs, &data, quads[i]);
+            write_depth_stencil_values(&data, quads[i]);
          }
          else {
             if (!depth_test_quad(qs, &data, quads[i]))
                continue;
+
+            if (qs->softpipe->depth_stencil->depth.writemask)
+               write_depth_stencil_values(&data, quads[i]);
          }
 
-         if (qs->softpipe->depth_stencil->stencil[0].enabled ||
-             qs->softpipe->depth_stencil->depth.writemask)
-            write_depth_stencil_values(&data, quads[i]);
 
          quads[pass++] = quads[i];
       }

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to