From 143783538a01ea04227c343f9a2ee4902f541e03 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 24 Jul 2021 12:52:15 -0400 Subject: [PATCH] asahi: Calculate resource offsets for cube maps Needed to transfer. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/asahi/agx_pipe.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index c0e31c2..4c4e761 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -243,6 +243,16 @@ agx_resource_create(struct pipe_screen *screen, return &nresource->base; } +static uint8_t * +agx_rsrc_offset(struct agx_resource *rsrc, unsigned level, unsigned z) +{ + struct agx_bo *bo = rsrc->bo; + uint8_t *map = ((uint8_t *) bo->ptr.cpu) + rsrc->slices[level].offset; + map += z * rsrc->array_stride; + + return map; +} + static void agx_resource_destroy(struct pipe_screen *screen, struct pipe_resource *prsrc) -- 2.7.4