mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 11:08:03 +02:00
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:
parent
be3d4ce8c4
commit
143783538a
1 changed files with 10 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue