From 5f55cbc7d93c6568566893f9345e43fff311a32b Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Tue, 1 May 2012 02:47:03 +0200 Subject: gallium: Add context hooks for binding shader resources. --- src/gallium/include/pipe/p_context.h | 32 ++++++++++++++++++++++++++++++++ src/gallium/include/pipe/p_defines.h | 2 ++ src/gallium/include/pipe/p_state.h | 1 + 3 files changed, 35 insertions(+) (limited to 'src/gallium/include') diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h index 3c0b89e9c2d..0951e70f481 100644 --- a/src/gallium/include/pipe/p_context.h +++ b/src/gallium/include/pipe/p_context.h @@ -229,6 +229,22 @@ struct pipe_context { unsigned start_slot, unsigned num_views, struct pipe_sampler_view **); + /** + * 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. + * + * \param first first resource to bind. + * \param count number of consecutive resources to bind. + * \param resources array of pointers to the resources to bind, it + * should contain at least \a count elements + * unless it's NULL, in which case no new + * resources will be bound. + */ + void (*set_shader_resources)(struct pipe_context *, + unsigned start, unsigned count, + struct pipe_surface **resources); + void (*set_vertex_buffers)( struct pipe_context *, unsigned num_buffers, const struct pipe_vertex_buffer * ); @@ -441,6 +457,22 @@ struct pipe_context { void (*bind_compute_state)(struct pipe_context *, void *); void (*delete_compute_state)(struct pipe_context *, void *); + /** + * Bind an array of shader resources that will be used by the + * compute program. Any resources that were previously bound to + * the specified range will be unbound after this call. + * + * \param first first resource to bind. + * \param count number of consecutive resources to bind. + * \param resources array of pointers to the resources to bind, it + * should contain at least \a count elements + * unless it's NULL, in which case no new + * resources will be bound. + */ + void (*set_compute_resources)(struct pipe_context *, + unsigned start, unsigned count, + struct pipe_surface **resources); + /** * Bind an array of buffers to be mapped into the address space of * the GLOBAL resource. Any buffers that were previously bound diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index c4c217b911f..9a0bce1c658 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -305,6 +305,8 @@ enum pipe_transfer_usage { #define PIPE_BIND_CURSOR (1 << 16) /* mouse cursor */ #define PIPE_BIND_CUSTOM (1 << 17) /* state-tracker/winsys usages */ #define PIPE_BIND_GLOBAL (1 << 18) /* set_global_binding */ +#define PIPE_BIND_SHADER_RESOURCE (1 << 19) /* set_shader_resources */ +#define PIPE_BIND_COMPUTE_RESOURCE (1 << 20) /* set_compute_resources */ /* The first two flags above were previously part of the amorphous * TEXTURE_USAGE, most of which are now descriptions of the ways a diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 74f4ebd8f4c..788ded58dcd 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -62,6 +62,7 @@ extern "C" { #define PIPE_MAX_GEOMETRY_SAMPLERS 16 #define PIPE_MAX_SHADER_INPUTS 32 #define PIPE_MAX_SHADER_OUTPUTS 32 +#define PIPE_MAX_SHADER_SAMPLER_VIEWS 32 #define PIPE_MAX_SHADER_RESOURCES 32 #define PIPE_MAX_TEXTURE_LEVELS 16 #define PIPE_MAX_SO_BUFFERS 4 -- cgit v1.2.3