gallium: remove PIPE_MAX_VERTEX/GEOMETRY_SAMPLERS #define
authorBrian Paul <brianp@vmware.com>
Fri, 10 Aug 2012 02:59:44 +0000 (20:59 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 16 Aug 2012 15:01:31 +0000 (09:01 -0600)
PIPE_MAX_SAMPLERS, PIPE_MAX_VERTEX_SAMPLERS and PIPE_MAX_GEOMETRY_SAMPLERS
were all defined to the same value (16).

In various places we're creating arrays such as
sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS] so we were assuming
the same number of max samplers for all shader stages anyway.

Of course, drivers are still free to advertise different numbers of max
samplers for different shaders.

21 files changed:
src/gallium/auxiliary/cso_cache/cso_context.c
src/gallium/auxiliary/draw/draw_llvm.c
src/gallium/auxiliary/draw/draw_llvm.h
src/gallium/auxiliary/draw/draw_llvm_sample.c
src/gallium/drivers/galahad/glhd_context.c
src/gallium/drivers/i915/i915_context.h
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/i915/i915_state.c
src/gallium/drivers/identity/id_context.c
src/gallium/drivers/llvmpipe/lp_context.c
src/gallium/drivers/llvmpipe/lp_context.h
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/llvmpipe/lp_state_sampler.c
src/gallium/drivers/rbug/rbug_context.c
src/gallium/drivers/rbug/rbug_context.h
src/gallium/drivers/softpipe/sp_context.c
src/gallium/drivers/softpipe/sp_context.h
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/drivers/trace/tr_context.c
src/gallium/include/pipe/p_state.h
src/mesa/state_tracker/st_context.h

index 7fb8caf1337da2602fc37a8a0d8faa620c6d1321..db4fa019a3529a66edd658a2ea74be226c9474b4 100644 (file)
@@ -256,8 +256,6 @@ struct cso_context *cso_create_context( struct pipe_context *pipe )
    if (ctx == NULL)
       goto out;
 
-   assert(PIPE_MAX_SAMPLERS == PIPE_MAX_VERTEX_SAMPLERS);
-
    ctx->cache = cso_cache_create();
    if (ctx->cache == NULL)
       goto out;
index 133aa5f698378af780323e331437a955c2d807d5..ebfe437261cdce4c5db7da0159260aa1e066e54d 100644 (file)
@@ -164,7 +164,7 @@ create_jit_context_type(struct gallivm_state *gallivm,
                                                  DRAW_TOTAL_CLIP_PLANES), 0);
    elem_types[3] = LLVMPointerType(float_type, 0); /* viewport */
    elem_types[4] = LLVMArrayType(texture_type,
-                                 PIPE_MAX_VERTEX_SAMPLERS); /* textures */
+                                 PIPE_MAX_SAMPLERS); /* textures */
    context_type = LLVMStructTypeInContext(gallivm->context, elem_types,
                                           Elements(elem_types), 0);
 #if HAVE_LLVM < 0x0300
@@ -1371,7 +1371,7 @@ draw_llvm_set_mapped_texture(struct draw_context *draw,
    unsigned j;
    struct draw_jit_texture *jit_tex;
 
-   assert(sampler_idx < PIPE_MAX_VERTEX_SAMPLERS);
+   assert(sampler_idx < Elements(draw->llvm->jit_context.textures));
 
    jit_tex = &draw->llvm->jit_context.textures[sampler_idx];
 
index 39d83cfe99f3e99e2f783d42c30df62057dd1a52..9a291a4762766b94723ebc31052e64084a4b9049 100644 (file)
@@ -97,7 +97,7 @@ struct draw_jit_context
    float (*planes) [DRAW_TOTAL_CLIP_PLANES][4];
    float *viewport;
 
-   struct draw_jit_texture textures[PIPE_MAX_VERTEX_SAMPLERS];
+   struct draw_jit_texture textures[PIPE_MAX_SAMPLERS];
 };
 
 
@@ -184,7 +184,7 @@ struct draw_llvm_variant_key
 
 #define DRAW_LLVM_MAX_VARIANT_KEY_SIZE \
    (sizeof(struct draw_llvm_variant_key) +     \
-    PIPE_MAX_VERTEX_SAMPLERS * sizeof(struct lp_sampler_static_state) +        \
+    PIPE_MAX_SAMPLERS * sizeof(struct lp_sampler_static_state) +       \
     (PIPE_MAX_ATTRIBS-1) * sizeof(struct pipe_vertex_element))
 
 
index 1dbe5f5bd19c133b132762eafa9606cb64fff7bc..53317165557322b0fdff9115c2212709d28714ca 100644 (file)
@@ -98,7 +98,7 @@ draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
    LLVMValueRef ptr;
    LLVMValueRef res;
 
-   debug_assert(unit < PIPE_MAX_VERTEX_SAMPLERS);
+   debug_assert(unit < PIPE_MAX_SAMPLERS);
 
    /* context[0] */
    indices[0] = lp_build_const_int32(gallivm, 0);
@@ -180,7 +180,7 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
 {
    struct draw_llvm_sampler_soa *sampler = (struct draw_llvm_sampler_soa *)base;
 
-   assert(unit < PIPE_MAX_VERTEX_SAMPLERS);
+   assert(unit < PIPE_MAX_SAMPLERS);
 
    lp_build_sample_soa(gallivm,
                        &sampler->dynamic_state.static_state[unit],
@@ -207,7 +207,7 @@ draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
 {
    struct draw_llvm_sampler_soa *sampler = (struct draw_llvm_sampler_soa *)base;
 
-   assert(unit < PIPE_MAX_VERTEX_SAMPLERS);
+   assert(unit < PIPE_MAX_SAMPLERS);
 
    lp_build_size_query_soa(gallivm,
                            &sampler->dynamic_state.static_state[unit],
index 01ab92341a0a157d79fffafcb762bef7ddb3c480..dc7f017d91e8619c4fb4685be1330e57bc1e5bdf 100644 (file)
@@ -208,10 +208,10 @@ galahad_context_bind_vertex_sampler_states(struct pipe_context *_pipe,
    struct galahad_context *glhd_pipe = galahad_context(_pipe);
    struct pipe_context *pipe = glhd_pipe->pipe;
 
-   if (num_samplers > PIPE_MAX_VERTEX_SAMPLERS) {
+   if (num_samplers > PIPE_MAX_SAMPLERS) {
       glhd_error("%u vertex samplers requested, "
          "but only %u are permitted by API",
-         num_samplers, PIPE_MAX_VERTEX_SAMPLERS);
+         num_samplers, PIPE_MAX_SAMPLERS);
    }
 
    pipe->bind_vertex_sampler_states(pipe,
@@ -587,14 +587,14 @@ galahad_context_set_vertex_sampler_views(struct pipe_context *_pipe,
 {
    struct galahad_context *glhd_pipe = galahad_context(_pipe);
    struct pipe_context *pipe = glhd_pipe->pipe;
-   struct pipe_sampler_view *unwrapped_views[PIPE_MAX_VERTEX_SAMPLERS];
+   struct pipe_sampler_view *unwrapped_views[PIPE_MAX_SAMPLERS];
    struct pipe_sampler_view **views = NULL;
    unsigned i;
 
    if (_views) {
       for (i = 0; i < num; i++)
          unwrapped_views[i] = galahad_sampler_view_unwrap(_views[i]);
-      for (; i < PIPE_MAX_VERTEX_SAMPLERS; i++)
+      for (; i < Elements(unwrapped_views); i++)
          unwrapped_views[i] = NULL;
 
       views = unwrapped_views;
index 16b0c57166de5edaf08bb6e5fa00d7685c91f1bc..c9198e270db451b9e41d0c525db05f28fefd3fdc 100644 (file)
@@ -230,7 +230,7 @@ struct i915_context {
     */
    const struct i915_blend_state           *blend;
    const struct i915_sampler_state         *sampler[PIPE_MAX_SAMPLERS];
-   struct pipe_sampler_state *vertex_samplers[PIPE_MAX_VERTEX_SAMPLERS];
+   struct pipe_sampler_state *vertex_samplers[PIPE_MAX_SAMPLERS];
    const struct i915_depth_stencil_state   *depth_stencil;
    const struct i915_rasterizer_state      *rasterizer;
 
@@ -250,8 +250,8 @@ struct i915_context {
 
    unsigned dirty;
 
-   struct pipe_resource *mapped_vs_tex[PIPE_MAX_VERTEX_SAMPLERS];
-   struct i915_winsys_buffer* mapped_vs_tex_buffer[PIPE_MAX_VERTEX_SAMPLERS];
+   struct pipe_resource *mapped_vs_tex[PIPE_MAX_SAMPLERS];
+   struct i915_winsys_buffer* mapped_vs_tex_buffer[PIPE_MAX_SAMPLERS];
 
    unsigned num_samplers;
    unsigned num_fragment_sampler_views;
index 35b343e0de8acc7f090d05b5297bc06a1127fe33..579337b0f2349c5ec33fe6e93618fef7fd6c7400 100644 (file)
@@ -107,7 +107,7 @@ i915_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_sha
       switch (cap) {
       case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
          if (debug_get_bool_option("DRAW_USE_LLVM", TRUE))
-            return PIPE_MAX_VERTEX_SAMPLERS;
+            return PIPE_MAX_SAMPLERS;
          else
             return 0;
        default:
index 8af26fa9dc54caf00327cffbe7a43357ea5dad1d..fdbff8b4a4e8eaf0ed3cdd9669260ebc66743d63 100644 (file)
@@ -310,7 +310,7 @@ i915_bind_vertex_sampler_states(struct pipe_context *pipe,
    struct i915_context *i915 = i915_context(pipe);
    unsigned i;
 
-   assert(num_samplers <= PIPE_MAX_VERTEX_SAMPLERS);
+   assert(num_samplers <= Elements(i915->vertex_samplers));
 
    /* Check for no-op */
    if (num_samplers == i915->num_vertex_samplers &&
@@ -319,7 +319,7 @@ i915_bind_vertex_sampler_states(struct pipe_context *pipe,
 
    for (i = 0; i < num_samplers; ++i)
       i915->vertex_samplers[i] = samplers[i];
-   for (i = num_samplers; i < PIPE_MAX_VERTEX_SAMPLERS; ++i)
+   for (i = num_samplers; i < Elements(i915->vertex_samplers); ++i)
       i915->vertex_samplers[i] = NULL;
 
    i915->num_vertex_samplers = num_samplers;
@@ -374,11 +374,11 @@ i915_prepare_vertex_sampling(struct i915_context *i915)
    unsigned num = i915->num_vertex_sampler_views;
    struct pipe_sampler_view **views = i915->vertex_sampler_views;
 
-   assert(num <= PIPE_MAX_VERTEX_SAMPLERS);
+   assert(num <= PIPE_MAX_SAMPLERS);
    if (!num)
       return;
 
-   for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
+   for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
       struct pipe_sampler_view *view = i < num ? views[i] : NULL;
 
       if (view) {
@@ -777,7 +777,7 @@ i915_set_vertex_sampler_views(struct pipe_context *pipe,
    struct i915_context *i915 = i915_context(pipe);
    uint i;
 
-   assert(num <= PIPE_MAX_VERTEX_SAMPLERS);
+   assert(num <= Elements(i915->vertex_sampler_views));
 
    /* Check for no-op */
    if (num == i915->num_vertex_sampler_views &&
@@ -785,7 +785,7 @@ i915_set_vertex_sampler_views(struct pipe_context *pipe,
       return;
    }
 
-   for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
+   for (i = 0; i < Elements(i915->vertex_sampler_views); i++) {
       struct pipe_sampler_view *view = i < num ? views[i] : NULL;
 
       pipe_sampler_view_reference(&i915->vertex_sampler_views[i], view);
index 2d47296f230df969f5c9a5361299a5a654d8a461..794e62ca1f2f06063854fadd33c85a73df1858ae 100644 (file)
@@ -517,14 +517,14 @@ identity_set_vertex_sampler_views(struct pipe_context *_pipe,
 {
    struct identity_context *id_pipe = identity_context(_pipe);
    struct pipe_context *pipe = id_pipe->pipe;
-   struct pipe_sampler_view *unwrapped_views[PIPE_MAX_VERTEX_SAMPLERS];
+   struct pipe_sampler_view *unwrapped_views[PIPE_MAX_SAMPLERS];
    struct pipe_sampler_view **views = NULL;
    unsigned i;
 
    if (_views) {
       for (i = 0; i < num; i++)
          unwrapped_views[i] = identity_sampler_view_unwrap(_views[i]);
-      for (; i < PIPE_MAX_VERTEX_SAMPLERS; i++)
+      for (; i < Elements(unwrapped_views); i++)
          unwrapped_views[i] = NULL;
 
       views = unwrapped_views;
index 7d0ca1f8cd8f0e724369fc961b3dbae56177db6b..dec347380296ea951f9bb4a49fb618c0027c0124 100644 (file)
@@ -69,11 +69,11 @@ static void llvmpipe_destroy( struct pipe_context *pipe )
 
    pipe_surface_reference(&llvmpipe->framebuffer.zsbuf, NULL);
 
-   for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
+   for (i = 0; i < Elements(llvmpipe->sampler_views[0]); i++) {
       pipe_sampler_view_reference(&llvmpipe->sampler_views[PIPE_SHADER_FRAGMENT][i], NULL);
    }
 
-   for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
+   for (i = 0; i < Elements(llvmpipe->sampler_views[0]); i++) {
       pipe_sampler_view_reference(&llvmpipe->sampler_views[PIPE_SHADER_VERTEX][i], NULL);
    }
 
index f8610ae8f0c3774efb265c03a7ff247f59060c6a..b7b7ede7eaf55e9a8db330591e7e808db88725da 100644 (file)
@@ -86,7 +86,7 @@ struct llvmpipe_context {
       int so_count[PIPE_MAX_SO_BUFFERS];
       int num_buffers;
    } so_target;
-   struct pipe_resource *mapped_vs_tex[PIPE_MAX_VERTEX_SAMPLERS];
+   struct pipe_resource *mapped_vs_tex[PIPE_MAX_SAMPLERS];
 
    unsigned num_samplers[PIPE_SHADER_TYPES];
    unsigned num_sampler_views[PIPE_SHADER_TYPES];
index 61aa1925eecda995ff13ddd59cd62c395f283a84..5f19a4753bae4b3dcea8a23f29c9289592d5d82a 100644 (file)
@@ -105,7 +105,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
 {
    switch (param) {
    case PIPE_CAP_MAX_COMBINED_SAMPLERS:
-      return PIPE_MAX_SAMPLERS + PIPE_MAX_VERTEX_SAMPLERS;
+      return 2 * PIPE_MAX_SAMPLERS;  /* VS + FS samplers */
    case PIPE_CAP_NPOT_TEXTURES:
       return 1;
    case PIPE_CAP_TWO_SIDED_STENCIL:
@@ -234,7 +234,7 @@ llvmpipe_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe
           * the draw module.
           */
          if (debug_get_bool_option("DRAW_USE_LLVM", TRUE))
-            return PIPE_MAX_VERTEX_SAMPLERS;
+            return PIPE_MAX_SAMPLERS;
          else
             return 0;
       default:
index 121569ede73354321ffd19145c3a18f504ba56cf..8e30b5c634a8fab42a7985297cdd07688e0b8460 100644 (file)
@@ -234,11 +234,11 @@ llvmpipe_prepare_vertex_sampling(struct llvmpipe_context *lp,
    uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS];
    const void *data[PIPE_MAX_TEXTURE_LEVELS];
 
-   assert(num <= PIPE_MAX_VERTEX_SAMPLERS);
+   assert(num <= PIPE_MAX_SAMPLERS);
    if (!num)
       return;
 
-   for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
+   for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
       struct pipe_sampler_view *view = i < num ? views[i] : NULL;
 
       if (view) {
index 65f0d71031ba3555bc4c8e837d0bdbc9e1c8616a..eb6230ed000dc448cfb8d90bd1832f9edc9ea3ab 100644 (file)
@@ -753,7 +753,7 @@ rbug_set_vertex_sampler_views(struct pipe_context *_pipe,
 {
    struct rbug_context *rb_pipe = rbug_context(_pipe);
    struct pipe_context *pipe = rb_pipe->pipe;
-   struct pipe_sampler_view *unwrapped_views[PIPE_MAX_VERTEX_SAMPLERS];
+   struct pipe_sampler_view *unwrapped_views[PIPE_MAX_SAMPLERS];
    struct pipe_sampler_view **views = NULL;
    unsigned i;
 
index 80c803da83f4a931092a705ce906b4a3e76b3c64..0a41bbd104729af9c3d7e68f81482a5698e2a266 100644 (file)
@@ -54,8 +54,8 @@ struct rbug_context {
       struct rbug_resource *fs_texs[PIPE_MAX_SAMPLERS];
       unsigned num_fs_views;
 
-      struct rbug_sampler_view *vs_views[PIPE_MAX_VERTEX_SAMPLERS];
-      struct rbug_resource *vs_texs[PIPE_MAX_VERTEX_SAMPLERS];
+      struct rbug_sampler_view *vs_views[PIPE_MAX_SAMPLERS];
+      struct rbug_resource *vs_texs[PIPE_MAX_SAMPLERS];
       unsigned num_vs_views;
 
       unsigned nr_cbufs;
index e2e32b9bd8cc05b9196d520e9a726b2e0f13074b..0360b3ba9fbe0c50f0aad58b173bef4cff684886 100644 (file)
@@ -216,10 +216,6 @@ softpipe_create_context( struct pipe_screen *screen,
    struct softpipe_context *softpipe = CALLOC_STRUCT(softpipe_context);
    uint i, sh;
 
-   /* Check since we have arrays[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS] */
-   STATIC_ASSERT(PIPE_MAX_SAMPLERS == PIPE_MAX_VERTEX_SAMPLERS);
-   STATIC_ASSERT(PIPE_MAX_SAMPLERS == PIPE_MAX_GEOMETRY_SAMPLERS);
-
    util_init_math();
 
    softpipe->dump_fs = debug_get_bool_option( "SOFTPIPE_DUMP_FS", FALSE );
@@ -290,13 +286,13 @@ softpipe_create_context( struct pipe_screen *screen,
 
    draw_texture_samplers(softpipe->draw,
                          PIPE_SHADER_VERTEX,
-                         PIPE_MAX_VERTEX_SAMPLERS,
+                         PIPE_MAX_SAMPLERS,
                          (struct tgsi_sampler **)
                             softpipe->tgsi.samplers_list[PIPE_SHADER_VERTEX]);
 
    draw_texture_samplers(softpipe->draw,
                          PIPE_SHADER_GEOMETRY,
-                         PIPE_MAX_GEOMETRY_SAMPLERS,
+                         PIPE_MAX_SAMPLERS,
                          (struct tgsi_sampler **)
                             softpipe->tgsi.samplers_list[PIPE_SHADER_GEOMETRY]);
 
index 2185fb8527781e03c4683a50d2ef96fe04997e9e..44599dd48456a0c007f99da1a8a916b1c0f0ffc0 100644 (file)
@@ -79,7 +79,7 @@ struct softpipe_context {
    struct pipe_framebuffer_state framebuffer;
    struct pipe_poly_stipple poly_stipple;
    struct pipe_scissor_state scissor;
-   struct pipe_sampler_view *sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_GEOMETRY_SAMPLERS];
+   struct pipe_sampler_view *sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
 
    struct pipe_viewport_state viewport;
    struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
index 5588611edcfed606a03f94558b6fefca6a257537..98a3e093f82f09440515d7f02846e5da4b9933dd 100644 (file)
@@ -67,7 +67,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
 {
    switch (param) {
    case PIPE_CAP_MAX_COMBINED_SAMPLERS:
-      return PIPE_MAX_SAMPLERS + PIPE_MAX_VERTEX_SAMPLERS;
+      return 2 * PIPE_MAX_SAMPLERS;  /* VS + FS */
    case PIPE_CAP_NPOT_TEXTURES:
       return 1;
    case PIPE_CAP_TWO_SIDED_STENCIL:
@@ -190,7 +190,7 @@ softpipe_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe
             /* Softpipe doesn't yet know how to tell draw/llvm about textures */
             return 0;
         else
-            return PIPE_MAX_VERTEX_SAMPLERS;
+            return PIPE_MAX_SAMPLERS;
       default:
         if (sp_screen->use_llvm)
             return draw_get_shader_param(shader, param);
index ffaa3d06939e40432f09655e82e9216055d6441e..17f7e95087f322150d4d1434f7c0f30aa81fa8f5 100644 (file)
@@ -998,7 +998,7 @@ trace_context_set_vertex_sampler_views(struct pipe_context *_pipe,
    struct trace_context *tr_ctx = trace_context(_pipe);
    struct trace_sampler_view *tr_view;
    struct pipe_context *pipe = tr_ctx->pipe;
-   struct pipe_sampler_view *unwrapped_views[PIPE_MAX_VERTEX_SAMPLERS];
+   struct pipe_sampler_view *unwrapped_views[PIPE_MAX_SAMPLERS];
    unsigned i;
 
    if (!pipe->set_vertex_sampler_views)
index 76559ad26491a6c03dfe15944cbd9eae5400378d..9ea9c0e328698b59424165aa49a774943200bff3 100644 (file)
@@ -58,8 +58,6 @@ extern "C" {
 #define PIPE_MAX_COLOR_BUFS        8
 #define PIPE_MAX_CONSTANT_BUFFERS 32
 #define PIPE_MAX_SAMPLERS         16
-#define PIPE_MAX_VERTEX_SAMPLERS  16
-#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
index 0dfd81c1b7983a83708b1c083bae9852963a8082..8afd7766362d5f8d0d84cedb2b6df48013e73ce7 100644 (file)
@@ -99,7 +99,7 @@ struct st_context
       struct pipe_depth_stencil_alpha_state depth_stencil;
       struct pipe_rasterizer_state          rasterizer;
       struct pipe_sampler_state    fragment_samplers[PIPE_MAX_SAMPLERS];
-      struct pipe_sampler_state    vertex_samplers[PIPE_MAX_VERTEX_SAMPLERS];
+      struct pipe_sampler_state    vertex_samplers[PIPE_MAX_SAMPLERS];
       struct pipe_clip_state clip;
       struct {
          void *ptr;
@@ -107,7 +107,7 @@ struct st_context
       } constants[PIPE_SHADER_TYPES];
       struct pipe_framebuffer_state framebuffer;
       struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS];
-      struct pipe_sampler_view *vertex_sampler_views[PIPE_MAX_VERTEX_SAMPLERS];
+      struct pipe_sampler_view *vertex_sampler_views[PIPE_MAX_SAMPLERS];
       struct pipe_scissor_state scissor;
       struct pipe_viewport_state viewport;
       unsigned sample_mask;