intel: Mark needed resolves when first enabling HiZ on a miptree
authorChad Versace <chad.versace@linux.intel.com>
Wed, 16 Nov 2011 02:21:09 +0000 (18:21 -0800)
committerChad Versace <chad.versace@linux.intel.com>
Tue, 22 Nov 2011 18:50:51 +0000 (10:50 -0800)
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/intel/intel_mipmap_tree.c

index b4f6bb31897b4a084ad2bc2d401476e609ecc74d..ffceda27029c3bd1329605195b4c14bd25cef52f 100644 (file)
@@ -594,7 +594,26 @@ intel_miptree_alloc_hiz(struct intel_context *intel,
                                      mt->height0,
                                      mt->depth0,
                                      true);
-   return mt->hiz_mt != NULL;
+
+   if (!mt->hiz_mt)
+      return false;
+
+   /* Mark that all slices need a HiZ resolve. */
+   struct intel_resolve_map *head = &mt->hiz_map;
+   for (int level = mt->first_level; level <= mt->last_level; ++level) {
+      for (int layer = 0; layer < mt->level[level].depth; ++layer) {
+        head->next = malloc(sizeof(*head->next));
+        head->next->prev = head;
+        head->next->next = NULL;
+        head = head->next;
+
+        head->level = level;
+        head->layer = layer;
+        head->need = INTEL_NEED_HIZ_RESOLVE;
+      }
+   }
+
+   return true;
 }
 
 void