return false;
}
- return rws->buffer_get_handle(rws, tex->buf, tex->tex.stride_in_bytes[0],
- 0, 0, whandle);
+ whandle->stride = tex->tex.stride_in_bytes[0];
+ whandle->offset = 0;
+
+ return rws->buffer_get_handle(rws, tex->buf, whandle);
}
static const struct u_resource_vtbl r300_texture_vtbl =
res->external_usage = usage;
}
- return rscreen->ws->buffer_get_handle(rscreen->ws, res->buf, stride,
- offset, slice_size, whandle);
+ whandle->stride = stride;
+ whandle->offset = offset + slice_size * whandle->layer;
+
+ return rscreen->ws->buffer_get_handle(rscreen->ws, res->buf, whandle);
}
static void r600_texture_destroy(struct pipe_screen *screen,
* \param ws The winsys instance for which the handle is to be valid
* \param buf A winsys buffer object to get the handle from.
* \param whandle A winsys handle pointer.
- * \param stride A stride of the buffer in bytes, for texturing.
* \return true on success.
*/
bool (*buffer_get_handle)(struct radeon_winsys *ws,
struct pb_buffer *buf,
- unsigned stride, unsigned offset,
- unsigned slice_size,
struct winsys_handle *whandle);
/**
res->external_usage = usage;
}
- return sscreen->ws->buffer_get_handle(sscreen->ws, res->buf, stride,
- offset, slice_size, whandle);
+ whandle->stride = stride;
+ whandle->offset = offset + slice_size * whandle->layer;
+
+ return sscreen->ws->buffer_get_handle(sscreen->ws, res->buf, whandle);
}
static void si_texture_destroy(struct pipe_screen *screen,
static bool amdgpu_bo_get_handle(struct radeon_winsys *rws,
struct pb_buffer *buffer,
- unsigned stride, unsigned offset,
- unsigned slice_size,
struct winsys_handle *whandle)
{
struct amdgpu_screen_winsys *sws = amdgpu_screen_winsys(rws);
util_hash_table_set(ws->bo_export_table, bo->bo, bo);
simple_mtx_unlock(&ws->bo_export_table_lock);
- whandle->stride = stride;
- whandle->offset = offset;
- whandle->offset += slice_size * whandle->layer;
bo->is_shared = true;
return true;
}
static bool radeon_winsys_bo_get_handle(struct radeon_winsys *rws,
struct pb_buffer *buffer,
- unsigned stride, unsigned offset,
- unsigned slice_size,
struct winsys_handle *whandle)
{
struct drm_gem_flink flink;
return false;
}
- whandle->stride = stride;
- whandle->offset = offset;
- whandle->offset += slice_size * whandle->layer;
-
return true;
}