[Mesa-dev] [v3 10/19] i965: Prepare slice validator for isl based miptrees
Topi Pohjolainen
topi.pohjolainen at gmail.com
Mon May 15 12:08:00 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 9df0cc3..5269a5e 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
@@ -746,9 +746,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 == ISL_SURF_DIM_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