summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_blitter.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-04-21 19:39:03 +0200
committerMarek Olšák <[email protected]>2013-04-23 20:26:20 +0200
commit1ba46bbb4c99caa7e297f2ec6717e962765275cb (patch)
tree19b3984a931d9e85c9c2f8f4ed65b68fa25dca22 /src/gallium/auxiliary/util/u_blitter.h
parentedd90a19ca2a13b8694f2560e77c9f02446cfaa7 (diff)
gallium/u_blitter: implement buffer clearing
Although this might be useful for ARB_clear_buffer_object, I need it for initializating resources in r600g. Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Brian Paul <[email protected]> v2: comment cleanups NOTE: This is a candidate for the 9.1 branch.
Diffstat (limited to 'src/gallium/auxiliary/util/u_blitter.h')
-rw-r--r--src/gallium/auxiliary/util/u_blitter.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_blitter.h b/src/gallium/auxiliary/util/u_blitter.h
index 20e69ed5b73..19015844ef7 100644
--- a/src/gallium/auxiliary/util/u_blitter.h
+++ b/src/gallium/auxiliary/util/u_blitter.h
@@ -276,7 +276,7 @@ void util_blitter_default_src_texture(struct pipe_sampler_view *src_templ,
/**
* Copy data from one buffer to another using the Stream Output functionality.
- * Some alignment is required, otherwise software fallback is used.
+ * 4-byte alignment is required, otherwise software fallback is used.
*/
void util_blitter_copy_buffer(struct blitter_context *blitter,
struct pipe_resource *dst,
@@ -286,6 +286,22 @@ void util_blitter_copy_buffer(struct blitter_context *blitter,
unsigned size);
/**
+ * Clear the contents of a buffer using the Stream Output functionality.
+ * 4-byte alignment is required.
+ *
+ * "num_channels" can be 1, 2, 3, or 4, and specifies if the clear value is
+ * R, RG, RGB, or RGBA.
+ *
+ * For each element, only "num_channels" components of "clear_value" are
+ * copied to the buffer, then the offset is incremented by num_channels*4.
+ */
+void util_blitter_clear_buffer(struct blitter_context *blitter,
+ struct pipe_resource *dst,
+ unsigned offset, unsigned size,
+ unsigned num_channels,
+ const union pipe_color_union *clear_value);
+
+/**
* Clear a region of a (color) surface to a constant value.
*
* These states must be saved in the blitter in addition to the state objects