i965: Restrict fast color clear on first slice only
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Tue, 14 Jun 2016 06:10:16 +0000 (09:10 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Fri, 25 Nov 2016 14:57:07 +0000 (16:57 +0200)
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_blorp.c

index d900e15a5c34e823d70bfb1789e12f672d630607..57b6f8b4fb4dd3b0d86c88d2d8126ab23bb36c4c 100644 (file)
@@ -819,6 +819,14 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
       intel_miptree_get_fast_clear_state(irb->mt, irb->mt_level,
                                          logical_layer);
 
+   /* Surface state can only record one fast clear color value. Therefore
+    * unless different levels/layers agree on the color it can be used to
+    * represent only single level/layer. Here it will be reserved for the
+    * first slice (level 0, layer 0).
+    */
+   if (irb->layer_count > 1 || irb->mt_level || irb->mt_layer)
+      can_fast_clear = false;
+
    if (can_fast_clear) {
       union gl_color_union override_color =
          brw_meta_convert_fast_clear_color(brw, irb->mt,