i965/blorp: Set aux_usage to NONE for miplevels without HiZ
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 10 Oct 2016 18:18:06 +0000 (11:18 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 15 Jun 2017 01:15:05 +0000 (18:15 -0700)
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
src/mesa/drivers/dri/i965/brw_blorp.c

index 4146f2986d2513e75a4fc97cd061df00e1b4d071..a7b24147746a8e0994849a74eb9ba2d2901dc8ca 100644 (file)
@@ -175,6 +175,10 @@ blorp_surf_for_miptree(struct brw_context *brw,
       }
    }
 
+   if (surf->aux_usage == ISL_AUX_USAGE_HIZ &&
+       !intel_miptree_level_has_hiz(mt, *level))
+      surf->aux_usage = ISL_AUX_USAGE_NONE;
+
    if (surf->aux_usage != ISL_AUX_USAGE_NONE) {
       /* We only really need a clear color if we also have an auxiliary
        * surface.  Without one, it does nothing.
@@ -1036,6 +1040,8 @@ intel_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
    blorp_surf_for_miptree(brw, &surf, mt, true, false, 0,
                           &level, start_layer, num_layers, isl_tmp);
 
+   assert(surf.aux_usage == ISL_AUX_USAGE_HIZ);
+
    struct blorp_batch batch;
    blorp_batch_init(&brw->blorp, &batch, brw, 0);
    blorp_hiz_op(&batch, &surf, level, start_layer, num_layers, op);