vc4: Fill out the stencil clear field.
authorEric Anholt <eric@anholt.net>
Fri, 5 Sep 2014 21:38:13 +0000 (14:38 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 9 Sep 2014 14:29:16 +0000 (07:29 -0700)
The rest of stencil handling isn't done yet, but it documents an extra
cl_u8(0) and helps make it obvious why we don't need to format clear_depth
the same way the depth/stencil buffer is formatted.

src/gallium/drivers/vc4/vc4_context.c
src/gallium/drivers/vc4/vc4_context.h
src/gallium/drivers/vc4/vc4_draw.c

index 7b9e6f097e9c9232235384548be1fb23e1970773..d14da676334610a0efb2e08b127bc264a08a9bef 100644 (file)
@@ -59,7 +59,7 @@ vc4_setup_rcl(struct vc4_context *vc4)
         cl_u32(&vc4->rcl, vc4->clear_color[0]);
         cl_u32(&vc4->rcl, vc4->clear_color[1]);
         cl_u32(&vc4->rcl, vc4->clear_depth);
-        cl_u8(&vc4->rcl, 0);
+        cl_u8(&vc4->rcl, vc4->clear_stencil);
 
         cl_start_reloc(&vc4->rcl, 1);
         cl_u8(&vc4->rcl, VC4_PACKET_TILE_RENDERING_MODE_CONFIG);
index c2fdcae231b86c21adc2a60e9dbae916bef82d0f..b82c08c5ff8be82d8b7460d429bea3e43a51024b 100644 (file)
@@ -146,6 +146,7 @@ struct vc4_context {
         uint32_t resolve;
         uint32_t clear_color[2];
         uint32_t clear_depth; /**< 24-bit unorm depth */
+        uint8_t clear_stencil;
 
         /**
          * Set if some drawing (triangles, blits, or just a glClear()) has
index d1035bb30ab65cc42aebf4143b8f859e2579e1eb..90d98b37b0110641578b58b54929edcb09d13983 100644 (file)
@@ -231,6 +231,9 @@ vc4_clear(struct pipe_context *pctx, unsigned buffers,
                 vc4->clear_depth = util_pack_z(PIPE_FORMAT_Z24X8_UNORM, depth);
         }
 
+        if (buffers & PIPE_CLEAR_STENCIL)
+                vc4->clear_stencil = stencil;
+
         vc4->cleared |= buffers;
         vc4->resolve |= buffers;