llvmpipe: point out that there's two stencil writemasks
authorBrian Paul <brianp@vmware.com>
Sun, 23 Oct 2011 16:08:06 +0000 (10:08 -0600)
committerBrian Paul <brianp@vmware.com>
Sun, 23 Oct 2011 16:09:34 +0000 (10:09 -0600)
In lp_build_stencil_op() the incoming 'stencil' var is a 2-element array.
There's a front-face writemask and a back-face writemask but we're ignoring
the later.  This patch doesn't fix anything but at least points out the
problem.

src/gallium/drivers/llvmpipe/lp_bld_depth.c

index 3e75e91fc095c07e0b49353b9e8688783770d3f2..87a6a2751d408e3240d6efdfa717068f66b27ead 100644 (file)
@@ -263,10 +263,11 @@ lp_build_stencil_op(struct lp_build_context *bld,
       res = lp_build_select(bld, front_facing, res, back_res);
    }
 
-   if (stencil->writemask != 0xff) {
-      /* mask &= stencil->writemask */
+   /* XXX what about the back-face writemask? */
+   if (stencil[0].writemask != 0xff) {
+      /* mask &= stencil[0].writemask */
       LLVMValueRef writemask = lp_build_const_int_vec(bld->gallivm, bld->type,
-                                                      stencil->writemask);
+                                                      stencil[0].writemask);
       mask = LLVMBuildAnd(builder, mask, writemask, "");
       /* res = (res & mask) | (stencilVals & ~mask) */
       res = lp_build_select_bitwise(bld, mask, res, stencilVals);