[Mesa-dev] [PATCH 02/12] intel: Add field intel_mipmap_slice::has_hiz
Chad Versace
chad.versace at linux.intel.com
Thu Feb 28 15:45:06 PST 2013
Performing a hiz operation with an ill-aligned rectangle primitive causes
GPU hanges on some hardware. Later patches will disable hiz on individual
slices to avoid such hangs.
However, this patch introduces no behavioral change. If `mt->hiz_mt` is
set, then this sets `has_hiz` for all slices in the miptree.
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 2 ++
src/mesa/drivers/dri/intel/intel_mipmap_tree.h | 12 ++++++++++++
2 files changed, 14 insertions(+)
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 2b66240..11726ac 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -887,6 +887,8 @@ intel_miptree_alloc_hiz(struct intel_context *intel,
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) {
+ mt->level[level].slice[layer].has_hiz = true;
+
head->next = malloc(sizeof(*head->next));
head->next->prev = head;
head->next->next = NULL;
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
index 2070be7..ed2ecc4 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
@@ -141,6 +141,18 @@ struct intel_mipmap_level
* intel_miptree_map/unmap on this slice.
*/
struct intel_miptree_map *map;
+
+ /**
+ * \brief Is hiz enabled for this slice?
+ *
+ * If `mt->level[l].slice[s].has_hiz` is true, then there exists a
+ * corresponding hiz slice at `mt->hiz_mt->level[l].slice[s]`.
+ *
+ * Performing a hiz operation with an ill-aligned rectangle primitive
+ * causes a GPU hang on some hardware. We selectively enable hiz on
+ * individual slices in order avoid such hangs.
+ */
+ bool has_hiz;
} *slice;
};
--
1.8.1.2
More information about the mesa-dev
mailing list