diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 21 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 13 |
2 files changed, 23 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index d589a591042..f0d304c3710 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -605,6 +605,27 @@ intel_lower_compressed_format(struct brw_context *brw, mesa_format format) } } +/** \brief Assert that the level and layer are valid for the miptree. */ +void +intel_miptree_check_level_layer(const struct intel_mipmap_tree *mt, + uint32_t level, + uint32_t layer) +{ + (void) mt; + (void) level; + (void) layer; + + assert(level >= mt->first_level); + assert(level <= mt->last_level); + + if (mt->surf.size > 0) + assert(layer < (mt->surf.dim == ISL_SURF_DIM_3D ? + minify(mt->surf.phys_level0_sa.depth, level) : + mt->surf.phys_level0_sa.array_len)); + else + assert(layer < mt->level[level].depth); +} + static enum isl_aux_state ** create_aux_state_map(struct intel_mipmap_tree *mt, enum isl_aux_state initial) diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h index 63cedb200ba..8cb06b86066 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h @@ -737,19 +737,10 @@ mesa_format intel_lower_compressed_format(struct brw_context *brw, mesa_format format); /** \brief Assert that the level and layer are valid for the miptree. */ -static inline void +void intel_miptree_check_level_layer(const struct intel_mipmap_tree *mt, uint32_t level, - uint32_t layer) -{ - (void) mt; - (void) level; - (void) layer; - - assert(level >= mt->first_level); - assert(level <= mt->last_level); - assert(layer < mt->level[level].depth); -} + uint32_t layer); void intel_miptree_reference(struct intel_mipmap_tree **dst, struct intel_mipmap_tree *src); |