asahi: Add size field to slices

Needed to size attachments for the kernel... for some reason. We already
compute this; just save it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15482>
This commit is contained in:
Alyssa Rosenzweig 2022-02-21 19:28:13 -05:00 committed by Marge Bot
parent f5ae88d36f
commit 2c23bb49ef
2 changed files with 4 additions and 1 deletions

View File

@ -186,7 +186,9 @@ agx_resource_create(struct pipe_screen *screen,
}
nresource->slices[l].offset = offset;
offset += ALIGN_POT(nresource->slices[l].line_stride * height, 0x80);
nresource->slices[l].size = ALIGN_POT(nresource->slices[l].line_stride * height, 0x80);
offset += nresource->slices[l].size;
}
/* Arrays and cubemaps have the entire miptree duplicated and page aligned (16K) */

View File

@ -251,6 +251,7 @@ struct agx_resource {
struct {
unsigned offset;
unsigned line_stride;
unsigned size;
} slices[PIPE_MAX_TEXTURE_LEVELS];
/* Bytes from one miptree to the next */