vc4: Don't look at back stencil state unless two-sided stencil is enabled.
authorEric Anholt <eric@anholt.net>
Mon, 20 Oct 2014 21:53:07 +0000 (22:53 +0100)
committerEric Anholt <eric@anholt.net>
Tue, 21 Oct 2014 14:16:41 +0000 (15:16 +0100)
Fixes regressions in the next bugfix, because gallium util stuff leaves
the back stencil state as 0 if !back->enabled.

src/gallium/drivers/vc4/vc4_state.c

index 31f24242860b75b73d7aeac9c83776f9620327df..99b5b3c727155670e5a639685df7933e94019f33 100644 (file)
@@ -203,12 +203,16 @@ vc4_create_depth_stencil_alpha_state(struct pipe_context *pctx,
 
                 uint8_t front_writemask_bits =
                         tlb_stencil_setup_writemask(front->writemask);
-                uint8_t back_writemask_bits =
-                        tlb_stencil_setup_writemask(back->writemask);
+                uint8_t back_writemask = front->writemask;
+                uint8_t back_writemask_bits = front_writemask_bits;
 
                 so->stencil_uniforms[0] =
                         tlb_stencil_setup_bits(front, front_writemask_bits);
                 if (back->enabled) {
+                        back_writemask = back->writemask;
+                        back_writemask_bits =
+                                tlb_stencil_setup_writemask(back->writemask);
+
                         so->stencil_uniforms[0] |= (1 << 30);
                         so->stencil_uniforms[1] =
                                 tlb_stencil_setup_bits(back, back_writemask_bits);