vc4: Skip sending down the clear colors if not clearing.
authorEric Anholt <eric@anholt.net>
Mon, 6 Apr 2015 22:19:30 +0000 (15:19 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 13 Apr 2015 17:39:24 +0000 (10:39 -0700)
src/gallium/drivers/vc4/vc4_context.c

index 9b2ee5cb2ed5dabe056dcafc55ed42efb09440bf..daa5ba5d4c619131488c78b3f6313e47cb63b2cb 100644 (file)
@@ -129,11 +129,13 @@ vc4_setup_rcl(struct vc4_context *vc4)
                                            branch_size +
                                            color_store_size));
 
-        cl_u8(&vc4->rcl, VC4_PACKET_CLEAR_COLORS);
-        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, vc4->clear_stencil);
+        if (vc4->cleared) {
+                cl_u8(&vc4->rcl, VC4_PACKET_CLEAR_COLORS);
+                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, vc4->clear_stencil);
+        }
 
         /* The rendering mode config determines the pointer that's used for
          * VC4_PACKET_STORE_MS_TILE_BUFFER address computations.  The kernel