Add layer support to export individual array layers.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
return rscreen->ws->buffer_get_handle(res->buf,
rtex->surface.level[0].pitch_bytes,
rtex->surface.level[0].offset,
+ rtex->surface.level[0].slice_size,
whandle);
}
*/
boolean (*buffer_get_handle)(struct pb_buffer *buf,
unsigned stride, unsigned offset,
+ unsigned slice_size,
struct winsys_handle *whandle);
/**
static boolean amdgpu_bo_get_handle(struct pb_buffer *buffer,
unsigned stride, unsigned offset,
+ unsigned slice_size,
struct winsys_handle *whandle)
{
struct amdgpu_winsys_bo *bo = amdgpu_winsys_bo(buffer);
whandle->stride = stride;
whandle->offset = offset;
+ whandle->offset += slice_size * whandle->layer;
bo->is_shared = true;
return TRUE;
}
static boolean radeon_winsys_bo_get_handle(struct pb_buffer *buffer,
unsigned stride, unsigned offset,
+ unsigned slice_size,
struct winsys_handle *whandle)
{
struct drm_gem_flink flink;
whandle->stride = stride;
whandle->offset = offset;
+ whandle->offset += slice_size * whandle->layer;
+
return TRUE;
}