[Mesa-dev] [v2 29/39] i965: Prepare slice validator for isl based miptrees
Topi Pohjolainen
topi.pohjolainen at gmail.com
Wed May 3 09:22:42 UTC 2017
Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
index 672b5f4..e699bb9 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
@@ -734,9 +734,16 @@ intel_miptree_check_level_layer(const struct intel_mipmap_tree *mt,
(void) level;
(void) layer;
- assert(level >= mt->first_level);
- assert(level <= mt->last_level);
- assert(layer < mt->level[level].depth);
+ if (mt->surf.size > 0) {
+ assert(level < mt->surf.levels);
+ assert(layer < (mt->surf.dim_layout == ISL_DIM_LAYOUT_GEN4_3D ?
+ mt->surf.phys_level0_sa.depth :
+ mt->surf.phys_level0_sa.array_len));
+ } else {
+ assert(level >= mt->first_level);
+ assert(level <= mt->last_level);
+ assert(layer < mt->level[level].depth);
+ }
}
void intel_miptree_reference(struct intel_mipmap_tree **dst,
--
2.9.3
More information about the mesa-dev
mailing list