From 2c23bb49effab7cdbb029f1651cf80a3e6177925 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 21 Feb 2022 19:28:13 -0500 Subject: [PATCH] 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 Part-of: --- src/gallium/drivers/asahi/agx_pipe.c | 4 +++- src/gallium/drivers/asahi/agx_state.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index 843725a98fc..3c2bec2412f 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -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) */ diff --git a/src/gallium/drivers/asahi/agx_state.h b/src/gallium/drivers/asahi/agx_state.h index 145c67c784f..558c7966d90 100644 --- a/src/gallium/drivers/asahi/agx_state.h +++ b/src/gallium/drivers/asahi/agx_state.h @@ -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 */