[Mesa-dev] [PATCH 20/26] i965: Resolve non-compressed fast clears prior layered rendering

Topi Pohjolainen topi.pohjolainen at gmail.com
Tue Oct 11 19:26:52 UTC 2016


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/brw_draw.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index e387eb9..df342d7 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -413,6 +413,21 @@ 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_msrt_mcs &&
+          !intel_miptree_is_lossless_compressed(brw, irb->mt)) {
+         assert(brw->gen >= 8);
+
+         for (unsigned i = 0; i < irb->layer_count; ++i) {
+            intel_miptree_resolve_color(
+               brw, irb->mt, irb->mt_level, irb->mt_layer + i, 0);
+         }
+      }
    }
 }
 
-- 
2.5.5



More information about the mesa-dev mailing list