mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
gallium/u_inlines: add helper for simplifying pipe_context::resource_copy_region
this hook has too many params, and I only need like half of them Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8624>
This commit is contained in:
parent
cacb3e1826
commit
53d9beb9b8
1 changed files with 17 additions and 0 deletions
|
|
@ -427,6 +427,23 @@ pipe_buffer_write_nooverlap(struct pipe_context *pipe,
|
|||
offset, size, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility for simplifying pipe_context::resource_copy_region calls
|
||||
*/
|
||||
static inline void
|
||||
pipe_buffer_copy(struct pipe_context *pipe,
|
||||
struct pipe_resource *dst,
|
||||
struct pipe_resource *src,
|
||||
unsigned dst_offset,
|
||||
unsigned src_offset,
|
||||
unsigned size)
|
||||
{
|
||||
struct pipe_box box;
|
||||
/* only these fields are used */
|
||||
box.x = (int)src_offset;
|
||||
box.width = (int)size;
|
||||
pipe->resource_copy_region(pipe, dst, 0, dst_offset, 0, 0, src, 0, &box);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new resource and immediately put data into it
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue