mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 19:20:12 +01:00
ail: Fix logic for buffer alignment
It turns out that specifically Z/S single-layer textures have the main miptree padded to the page size, but not others. Signed-off-by: Asahi Lina <lina@asahilina.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20031>
This commit is contained in:
parent
ecdcb3e1aa
commit
c39ca7007f
1 changed files with 6 additions and 6 deletions
|
|
@ -163,12 +163,12 @@ ail_initialize_twiddled(struct ail_layout *layout)
|
|||
poth_el = u_minify(poth_el, 1);
|
||||
}
|
||||
|
||||
/* Arrays and cubemaps have the entire miptree duplicated and page aligned,
|
||||
* but only when mipmaps are enabled and the layer is larger than one page.
|
||||
*/
|
||||
if ((layout->levels != 1 && layout->depth_px != 1 && offset_B > AIL_PAGESIZE)
|
||||
|| layout->tiling != AIL_TILING_TWIDDLED_COMPRESSED)
|
||||
layout->page_aligned_layers = true;
|
||||
/* 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;
|
||||
|
||||
/* Single-layer images are not padded unless they are Z/S */
|
||||
if (layout->depth_px == 1 && !util_format_is_depth_or_stencil(layout->format))
|
||||
layout->page_aligned_layers = false;
|
||||
|
||||
if (layout->page_aligned_layers)
|
||||
layout->layer_stride_B = ALIGN_POT(offset_B, AIL_PAGESIZE);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue