ail: report mip_tail_first_lod for sparse

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-09 15:24:51 -05:00
committed by Marge Bot
parent 09cd1bf000
commit 2cac211946
2 changed files with 11 additions and 0 deletions

View File

@@ -175,6 +175,11 @@ ail_initialize_twiddled(struct ail_layout *layout)
assert(layout->levels < ARRAY_SIZE(layout->level_offsets_B));
layout->level_offsets_B[layout->levels] = offset_B;
/* Determine the start of the miptail. From that level on, we can no longer
* precisely bind at page granularity.
*/
layout->mip_tail_first_lod = MIN2(pot_level, layout->levels);
/* 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

@@ -118,6 +118,12 @@ struct ail_layout {
*/
uint32_t stride_el[AIL_MAX_MIP_LEVELS];
/**
* If the image is bound sparsely, the first LOD/level of the miptail.
* This corresponds to Vulkan imageMipTailFirstLod.
*/
uint32_t mip_tail_first_lod;
/* Offset of the start of the compression metadata buffer */
uint32_t metadata_offset_B;