summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTopi Pohjolainen <[email protected]>2017-04-25 13:10:34 +0300
committerTopi Pohjolainen <[email protected]>2017-06-19 22:41:45 +0300
commitc05817ffc5ff9f8979250ecd3488be357c854be5 (patch)
treeb5c3961fe7d20f7e0ab5d352a8cfedfbea99cbfa /src/mesa
parent143e3a679a99334bc1d2e18c1000422782c999ed (diff)
i965: Prepare slice validator for isl based miptrees
v2 (Nanley): Minify depth in case of 3D surface. Also moved to .c file to get minify() without additional header inclusions Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c21
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.h13
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);