intel/blorp: Add plumbing for color resolve slice details
authorPohjolainen, Topi <topi.pohjolainen@gmail.com>
Tue, 11 Oct 2016 19:26:35 +0000 (22:26 +0300)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 17 Nov 2016 20:03:24 +0000 (12:03 -0800)
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/blorp/blorp.h
src/intel/blorp/blorp_clear.c
src/mesa/drivers/dri/i965/brw_blorp.c

index 1a38cc96509429126b3c69d20dbd0ab4f2411d45..4e5a3a33ad6f31ffb7892378f12c53143806981f 100644 (file)
@@ -169,7 +169,8 @@ blorp_clear_attachments(struct blorp_batch *batch,
 
 void
 blorp_ccs_resolve(struct blorp_batch *batch,
-                  struct blorp_surf *surf, enum isl_format format);
+                  struct blorp_surf *surf, uint32_t level, uint32_t layer,
+                  enum isl_format format);
 
 /**
  * For an overview of the HiZ operations, see the following sections of the
index ea80c193c5759b4fb6d2c2637bebe858b196747d..5c40e2f0557408dc2b495931b54851b886af005e 100644 (file)
@@ -542,13 +542,18 @@ blorp_clear_attachments(struct blorp_batch *batch,
 
 void
 blorp_ccs_resolve(struct blorp_batch *batch,
-                  struct blorp_surf *surf, enum isl_format format)
+                  struct blorp_surf *surf, uint32_t level, uint32_t layer,
+                  enum isl_format format)
 {
    struct blorp_params params;
    blorp_params_init(&params);
 
+   /* Layered and mipmapped fast clear is only available from Gen8 onwards. */
+   assert(ISL_DEV_GEN(batch->blorp->isl_dev) >= 8 ||
+          (level == 0 && layer == 0));
+
    brw_blorp_surface_info_init(batch->blorp, &params.dst, surf,
-                               0 /* level */, 0 /* layer */, format, true);
+                               level, layer, format, true);
 
    /* From the Ivy Bridge PRM, Vol2 Part1 11.9 "Render Target Resolve":
     *
index f0ad0743cdf1e33876afcd0a9707c64788918771..2771f1466db420e04b536a4bdfb8b7b642dfd2b5 100644 (file)
@@ -945,7 +945,7 @@ brw_blorp_resolve_color(struct brw_context *brw, struct intel_mipmap_tree *mt)
 
    struct blorp_batch batch;
    blorp_batch_init(&brw->blorp, &batch, brw, 0);
-   blorp_ccs_resolve(&batch, &surf,
+   blorp_ccs_resolve(&batch, &surf, 0 /* level */, 0 /* layer */,
                      brw_blorp_to_isl_format(brw, format, true));
    blorp_batch_finish(&batch);