asahi: Align allocations to effective tile size

May be smaller than 64x64.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14903>
This commit is contained in:
Alyssa Rosenzweig 2022-02-06 10:05:40 -05:00 committed by Marge Bot
parent 25f48996a6
commit 5d957011ff
1 changed files with 5 additions and 2 deletions

View File

@ -165,14 +165,17 @@ agx_resource_create(struct pipe_screen *screen,
nresource->modifier = agx_select_modifier(nresource);
unsigned offset = 0;
unsigned blocksize = util_format_get_blocksize(templ->format);
for (unsigned l = 0; l <= templ->last_level; ++l) {
unsigned width = u_minify(templ->width0, l);
unsigned height = u_minify(templ->height0, l);
if (nresource->modifier == DRM_FORMAT_MOD_APPLE_64X64_MORTON_ORDER) {
width = ALIGN_POT(width, 64);
height = ALIGN_POT(height, 64);
unsigned tile = agx_select_tile_size(templ->width0, templ->height0, l, blocksize);
width = ALIGN_POT(width, tile);
height = ALIGN_POT(height, tile);
}
nresource->slices[l].line_stride =