summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTopi Pohjolainen <[email protected]>2017-06-13 12:30:26 +0300
committerTopi Pohjolainen <[email protected]>2017-06-19 22:57:56 +0300
commit0e816c9deb6f45a0053f35dd683868605b98c53c (patch)
tree1ecc96514ba37f3f914a5671d079b31e9eb8809f /src/mesa
parenta808eb172ae2806ea071acabd2e2ef822e2d563e (diff)
i965/miptree: Prepare range getter for isl based
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.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index b5e30e8e1da..455878c5a40 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -2513,7 +2513,14 @@ miptree_layer_range_length(const struct intel_mipmap_tree *mt, uint32_t level,
uint32_t start_layer, uint32_t num_layers)
{
assert(level <= mt->last_level);
- uint32_t total_num_layers = mt->level[level].depth;
+ uint32_t total_num_layers;
+
+ if (mt->surf.size > 0)
+ total_num_layers = mt->surf.dim == ISL_SURF_DIM_3D ?
+ minify(mt->surf.phys_level0_sa.depth, level) :
+ mt->surf.phys_level0_sa.array_len;
+ else
+ total_num_layers = mt->level[level].depth;
assert(start_layer < total_num_layers);
if (num_layers == INTEL_REMAINING_LAYERS)