gallium: add interface for writable shader buffers

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
Marek Olšák
2015-07-05 15:00:22 +02:00
parent 05a12c53a3
commit 8fba933ca2
2 changed files with 28 additions and 0 deletions
+18
View File
@@ -58,6 +58,7 @@ struct pipe_resource;
struct pipe_sampler_state;
struct pipe_sampler_view;
struct pipe_scissor_state;
struct pipe_shader_buffer;
struct pipe_shader_state;
struct pipe_stencil_ref;
struct pipe_stream_output_target;
@@ -236,6 +237,23 @@ struct pipe_context {
const float default_outer_level[4],
const float default_inner_level[2]);
/**
* Bind an array of shader buffers that will be used by a shader.
* Any buffers that were previously bound to the specified range
* will be unbound.
*
* \param shader selects shader stage
* \param start_slot first buffer slot to bind.
* \param count number of consecutive buffers to bind.
* \param buffers array of pointers to the buffers to bind, it
* should contain at least \a count elements
* unless it's NULL, in which case no buffers will
* be bound.
*/
void (*set_shader_buffers)(struct pipe_context *, unsigned shader,
unsigned start_slot, unsigned count,
struct pipe_shader_buffer *buffers);
/**
* Bind an array of images that will be used by a shader.
* Any images that were previously bound to the specified range
+10
View File
@@ -493,6 +493,16 @@ struct pipe_constant_buffer
};
/**
* An untyped shader buffer supporting loads, stores, and atomics.
*/
struct pipe_shader_buffer {
struct pipe_resource *buffer; /**< the actual buffer */
unsigned buffer_offset; /**< offset to start of data in buffer, in bytes */
unsigned buffer_size; /**< how much data can be read in shader */
};
/**
* A stream output target. The structure specifies the range vertices can
* be written to.