diff options
author | Topi Pohjolainen <[email protected]> | 2017-06-13 21:30:45 +0300 |
---|---|---|
committer | Topi Pohjolainen <[email protected]> | 2017-07-20 11:32:21 +0300 |
commit | ba4d0593f962602de3a4c732f82dc75173c48427 (patch) | |
tree | 360e2dacdebae8a278a7362f07fd4c1634a56ab5 | |
parent | bec048d9e22edae1663f92b57f2e64e4593a676a (diff) |
i965/miptree: Prepare aux state map for isl based
Reviewed-by: Jason Ekstrand <[email protected]>
Signed-off-by: Topi Pohjolainen <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index b586945c1a1..d4e1dcefa97 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -698,8 +698,14 @@ create_aux_state_map(struct intel_mipmap_tree *mt, const uint32_t levels = mt->last_level + 1; uint32_t total_slices = 0; - for (uint32_t level = 0; level < levels; level++) - total_slices += mt->level[level].depth; + for (uint32_t level = 0; level < levels; level++) { + if (mt->surf.size > 0) + total_slices += (mt->surf.dim == ISL_SURF_DIM_3D ? + minify(mt->surf.phys_level0_sa.depth, level) : + mt->surf.phys_level0_sa.array_len); + else + total_slices += mt->level[level].depth; + } const size_t per_level_array_size = levels * sizeof(enum isl_aux_state *); @@ -717,7 +723,16 @@ create_aux_state_map(struct intel_mipmap_tree *mt, enum isl_aux_state *s = data + per_level_array_size; for (uint32_t level = 0; level < levels; level++) { per_level_arr[level] = s; - for (uint32_t a = 0; a < mt->level[level].depth; a++) + + unsigned level_depth; + if (mt->surf.size > 0) + level_depth = mt->surf.dim == ISL_SURF_DIM_3D ? + minify(mt->surf.phys_level0_sa.depth, level) : + mt->surf.phys_level0_sa.array_len; + else + level_depth = mt->level[level].depth; + + for (uint32_t a = 0; a < level_depth; a++) *(s++) = initial; } assert((void *)s == data + total_size); |