i965: Resolve non-compressed fast clears prior layered rendering
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Mon, 13 Jun 2016 07:51:10 +0000 (10:51 +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_draw.c

index 0e0bc2700f51f33f1c10543e17f8bccb295fda21..d4cc2235a45fdd3a6aceb273ba3178c73b6a780f 100644 (file)
@@ -411,6 +411,19 @@ brw_predraw_set_aux_buffers(struct brw_context *brw)
       if (!irb) {
          continue;
       }
+
+      /* For layered rendering non-compressed fast cleared buffers need to be
+       * resolved. Surface state can carry only one fast color clear value
+       * while each layer may have its own fast clear color value. For
+       * compressed buffers color value is available in the color buffer.
+       */
+      if (irb->layer_count > 1 && !irb->mt->no_ccs &&
+          !intel_miptree_is_lossless_compressed(brw, irb->mt)) {
+         assert(brw->gen >= 8);
+
+         intel_miptree_resolve_color(brw, irb->mt, irb->mt_level,
+                                     irb->mt_layer, irb->layer_count, 0);
+      }
    }
 }