summaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe/p_context.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-07-05 14:48:33 +0200
committerMarek Olšák <[email protected]>2015-07-16 16:52:20 +0200
commit05a12c53a308965aba1c00f0caf36d8e0f32e035 (patch)
tree7914bcae5a16fff973d438326b3cc9749de8d22b /src/gallium/include/pipe/p_context.h
parentb73bec0ecd43861337daf9663e242d2b44f36dbd (diff)
gallium: add interface for writable shader images
PIPE_CAPs will be added some other time. Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/include/pipe/p_context.h')
-rw-r--r--src/gallium/include/pipe/p_context.h35
1 files changed, 24 insertions, 11 deletions
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index d2c2e4c8d14..76873956cc0 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -48,6 +48,7 @@ struct pipe_depth_stencil_alpha_state;
struct pipe_draw_info;
struct pipe_fence_handle;
struct pipe_framebuffer_state;
+struct pipe_image_view;
struct pipe_index_buffer;
struct pipe_query;
struct pipe_poly_stipple;
@@ -236,20 +237,21 @@ struct pipe_context {
const float default_inner_level[2]);
/**
- * Bind an array of shader resources that will be used by the
- * graphics pipeline. Any resources that were previously bound to
- * the specified range will be unbound after this call.
+ * Bind an array of images that will be used by a shader.
+ * Any images that were previously bound to the specified range
+ * will be unbound.
*
- * \param start first resource to bind.
- * \param count number of consecutive resources to bind.
- * \param resources array of pointers to the resources to bind, it
+ * \param shader selects shader stage
+ * \param start_slot first image slot to bind.
+ * \param count number of consecutive images to bind.
+ * \param buffers array of pointers to the images to bind, it
* should contain at least \a count elements
- * unless it's NULL, in which case no new
- * resources will be bound.
+ * unless it's NULL, in which case no images will
+ * be bound.
*/
- void (*set_shader_resources)(struct pipe_context *,
- unsigned start, unsigned count,
- struct pipe_surface **resources);
+ void (*set_shader_images)(struct pipe_context *, unsigned shader,
+ unsigned start_slot, unsigned count,
+ struct pipe_image_view **images);
void (*set_vertex_buffers)( struct pipe_context *,
unsigned start_slot,
@@ -398,6 +400,17 @@ struct pipe_context {
struct pipe_surface *);
/**
+ * Create an image view into a buffer or texture to be used with load,
+ * store, and atomic instructions by a shader stage.
+ */
+ struct pipe_image_view * (*create_image_view)(struct pipe_context *ctx,
+ struct pipe_resource *texture,
+ const struct pipe_image_view *templat);
+
+ void (*image_view_destroy)(struct pipe_context *ctx,
+ struct pipe_image_view *view);
+
+ /**
* Map a resource.
*
* Transfers are (by default) context-private and allow uploads to be