ail: Introduce layer_alignment flag
The hardware uses this flag to determine whether layer strides are implicitly aligned to the page size or not. Signed-off-by: Asahi Lina <lina@asahilina.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20031>
This commit is contained in:
@@ -168,6 +168,9 @@ ail_initialize_twiddled(struct ail_layout *layout)
|
||||
*/
|
||||
if ((layout->levels != 1 && layout->depth_px != 1 && offset_B > AIL_PAGESIZE)
|
||||
|| layout->tiling != AIL_TILING_TWIDDLED_COMPRESSED)
|
||||
layout->page_aligned_layers = true;
|
||||
|
||||
if (layout->page_aligned_layers)
|
||||
layout->layer_stride_B = ALIGN_POT(offset_B, AIL_PAGESIZE);
|
||||
else
|
||||
layout->layer_stride_B = offset_B;
|
||||
|
||||
@@ -99,6 +99,12 @@ struct ail_layout {
|
||||
*/
|
||||
uint32_t layer_stride_B;
|
||||
|
||||
/**
|
||||
* Whether the layer stride is aligned to the page size or not. The hardware
|
||||
* needs this flag to compute the implicit layer stride.
|
||||
*/
|
||||
bool page_aligned_layers;
|
||||
|
||||
/**
|
||||
* Offsets of mip levels within a layer.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user