gallium: Introduce separate vertex texture/sampler state.
authorMichal Krol <michal@vmware.com>
Tue, 1 Dec 2009 07:33:43 +0000 (08:33 +0100)
committerMichal Krol <michal@vmware.com>
Tue, 1 Dec 2009 08:51:56 +0000 (09:51 +0100)
Previously, gallium shared sampler and texture state between vertex
and fragment shader stages. This change generalises this concept by
providing separate entrypoints for vertex and fragment sampler state
setting.

A new capability bit is added to query the driver for the number
of samplers that can be utilised by a vertex and fragment shader
at the same time.

src/gallium/include/pipe/p_context.h
src/gallium/include/pipe/p_defines.h
src/gallium/include/pipe/p_state.h

index 5569001e601b12bdbd4c3fdb7e582ef64895a2fc..f896001eb12091d3d7035eb908731e42ca4258ab 100644 (file)
@@ -123,7 +123,12 @@ struct pipe_context {
 
    void * (*create_sampler_state)(struct pipe_context *,
                                   const struct pipe_sampler_state *);
-   void   (*bind_sampler_states)(struct pipe_context *, unsigned num, void **);
+   void   (*bind_fragment_sampler_states)(struct pipe_context *,
+                                          unsigned num_samplers,
+                                          void **samplers);
+   void   (*bind_vertex_sampler_states)(struct pipe_context *,
+                                        unsigned num_samplers,
+                                        void **samplers);
    void   (*delete_sampler_state)(struct pipe_context *, void *);
 
    void * (*create_rasterizer_state)(struct pipe_context *,
@@ -173,9 +178,13 @@ struct pipe_context {
    void (*set_viewport_state)( struct pipe_context *,
                                const struct pipe_viewport_state * );
 
-   void (*set_sampler_textures)( struct pipe_context *,
-                                 unsigned num_textures,
-                                 struct pipe_texture ** );
+   void (*set_fragment_sampler_textures)(struct pipe_context *,
+                                         unsigned num_textures,
+                                         struct pipe_texture **);
+
+   void (*set_vertex_sampler_textures)(struct pipe_context *,
+                                       unsigned num_textures,
+                                       struct pipe_texture **);
 
    void (*set_vertex_buffers)( struct pipe_context *,
                                unsigned num_buffers,
index fd14dc8e92d71231b31e69447f59b22d89448d9e..69a0970d5f80d4c5c467208faf0572228c38eb26 100644 (file)
@@ -390,6 +390,8 @@ enum pipe_transfer_usage {
 #define PIPE_CAP_BLEND_EQUATION_SEPARATE 28
 #define PIPE_CAP_SM3                     29  /*< Shader Model 3 supported */
 #define PIPE_CAP_MAX_PREDICATE_REGISTERS 30
+#define PIPE_CAP_MAX_COMBINED_SAMPLERS   31  /*< Maximum texture image units accessible from vertex
+                                                 and fragment shaders combined */
 
 
 /**
index 9766e86620c06392ab1d5f3186a30fbaa473f422..6de7af6a81c602b41dea0fd6c6163e485565e17a 100644 (file)
@@ -60,6 +60,7 @@ extern "C" {
 #define PIPE_MAX_COLOR_BUFS        8
 #define PIPE_MAX_CONSTANT         32
 #define PIPE_MAX_SAMPLERS         16
+#define PIPE_MAX_VERTEX_SAMPLERS  16
 #define PIPE_MAX_SHADER_INPUTS    16
 #define PIPE_MAX_SHADER_OUTPUTS   16
 #define PIPE_MAX_TEXTURE_LEVELS   16