i965/miptree: Prepare has_color_unresolved() for isl based
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Wed, 28 Jun 2017 07:04:10 +0000 (10:04 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Fri, 21 Jul 2017 21:14:16 +0000 (00:14 +0300)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/intel_mipmap_tree.c

index 56f524abca574c9ee68def233fef850539cfd1b8..3cbdf3c938a8d83abb8917be185b9db6fbe123aa 100644 (file)
@@ -2197,7 +2197,11 @@ intel_miptree_has_color_unresolved(const struct intel_mipmap_tree *mt,
    num_levels = last_level - start_level + 1;
 
    for (uint32_t level = start_level; level <= last_level; level++) {
-      const uint32_t level_layers = MIN2(num_layers, mt->level[level].depth);
+      uint32_t level_layers = mt->surf.size > 0 ?
+         get_num_phys_layers(&mt->surf, level) : mt->level[level].depth;
+
+      level_layers = MIN2(num_layers, level_layers);
+
       for (unsigned a = 0; a < level_layers; a++) {
          enum isl_aux_state aux_state =
             intel_miptree_get_aux_state(mt, level, start_layer + a);