asahi: Calculate resource offsets for cube maps

Needed to transfer.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12053>
This commit is contained in:
Alyssa Rosenzweig 2021-07-24 12:52:15 -04:00
parent be3d4ce8c4
commit 143783538a

View file

@ -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)