ail: report miptail stride

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33682>
This commit is contained in:
Alyssa Rosenzweig
2025-01-29 15:10:34 -05:00
committed by Marge Bot
parent 2cac211946
commit 7d27fd84d5
2 changed files with 14 additions and 0 deletions

View File

@@ -180,6 +180,12 @@ ail_initialize_twiddled(struct ail_layout *layout)
*/
layout->mip_tail_first_lod = MIN2(pot_level, layout->levels);
/* Determine the stride of the miptail. Sparse arrayed images inherently
* require page-aligned layers to be able to bind individual layers.
*/
unsigned tail_offset_B = layout->level_offsets_B[layout->mip_tail_first_lod];
layout->mip_tail_stride = align(offset_B - tail_offset_B, AIL_PAGESIZE);
/* Align layer size if we have mipmaps and one miptree is larger than one
* page */
layout->page_aligned_layers = layout->levels != 1 && offset_B > AIL_PAGESIZE;

View File

@@ -124,6 +124,14 @@ struct ail_layout {
*/
uint32_t mip_tail_first_lod;
/**
* If the image is bound sparsely, the layer stride of the miptail.
* Conceptually, this corresponds to Vulkan imageMipTailStride. However, it
* is not actually used for imageMipTailStride due to complications with
* standard sparse block sizes.
*/
uint32_t mip_tail_stride;
/* Offset of the start of the compression metadata buffer */
uint32_t metadata_offset_B;