From 53d9beb9b883484b6de6ff4629179c4631ff17ca Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 9 Sep 2020 14:35:23 -0400 Subject: [PATCH] gallium/u_inlines: add helper for simplifying pipe_context::resource_copy_region MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this hook has too many params, and I only need like half of them Reviewed-by: Marek Olšák Part-of: --- src/gallium/auxiliary/util/u_inlines.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index c5aadc7ca18..3663629d4d9 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -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