gallium: replace PIPE_ATTRIB_MAX with PIPE_MAX_ATTRIBS
authorBrian <brian.paul@tungstengraphics.com>
Thu, 27 Mar 2008 23:41:55 +0000 (17:41 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Thu, 27 Mar 2008 23:41:55 +0000 (17:41 -0600)
The later follows the naming scheme of other limits.
Keep the old definition until all possible usage is updated.

29 files changed:
src/gallium/auxiliary/draw/draw_context.c
src/gallium/auxiliary/draw/draw_private.h
src/gallium/auxiliary/draw/draw_pt_fetch_emit.c
src/gallium/auxiliary/draw/draw_vf.c
src/gallium/auxiliary/draw/draw_vf.h
src/gallium/auxiliary/draw/draw_vs_exec.c
src/gallium/auxiliary/draw/draw_vs_llvm.c
src/gallium/auxiliary/draw/draw_vs_sse.c
src/gallium/drivers/cell/ppu/cell_context.h
src/gallium/drivers/cell/ppu/cell_draw_arrays.c
src/gallium/drivers/cell/ppu/cell_state_vertex.c
src/gallium/drivers/cell/ppu/cell_vertex_fetch.c
src/gallium/drivers/cell/spu/spu_main.c
src/gallium/drivers/cell/spu/spu_vertex_shader.c
src/gallium/drivers/cell/spu/spu_vertex_shader.h
src/gallium/drivers/failover/fo_context.h
src/gallium/drivers/failover/fo_state_emit.c
src/gallium/drivers/i915simple/i915_context.c
src/gallium/drivers/i915simple/i915_context.h
src/gallium/drivers/i965simple/brw_clip.h
src/gallium/drivers/i965simple/brw_context.h
src/gallium/drivers/i965simple/brw_state.c
src/gallium/drivers/i965simple/brw_wm.h
src/gallium/drivers/softpipe/sp_context.h
src/gallium/drivers/softpipe/sp_draw_arrays.c
src/gallium/drivers/softpipe/sp_quad_fs.c
src/gallium/drivers/softpipe/sp_state_vertex.c
src/gallium/include/pipe/p_state.h
src/mesa/state_tracker/st_draw.c

index 903cc26..81858e0 100644 (file)
@@ -238,7 +238,7 @@ draw_set_vertex_buffer(struct draw_context *draw,
                        const struct pipe_vertex_buffer *buffer)
 {
    draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
-   assert(attr < PIPE_ATTRIB_MAX);
+   assert(attr < PIPE_MAX_ATTRIBS);
    draw->vertex_buffer[attr] = *buffer;
 }
 
@@ -249,7 +249,7 @@ draw_set_vertex_element(struct draw_context *draw,
                         const struct pipe_vertex_element *element)
 {
    draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
-   assert(attr < PIPE_ATTRIB_MAX);
+   assert(attr < PIPE_MAX_ATTRIBS);
    draw->vertex_element[attr] = *element;
 }
 
index 7007ee2..8eb2f51 100644 (file)
@@ -228,8 +228,8 @@ struct draw_context
    /* pipe state that we need: */
    const struct pipe_rasterizer_state *rasterizer;
    struct pipe_viewport_state viewport;
-   struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];
-   struct pipe_vertex_element vertex_element[PIPE_ATTRIB_MAX];
+   struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
+   struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS];
    struct draw_vertex_shader *vertex_shader;
 
    uint num_vs_outputs;  /**< convenience, from vertex_shader */
@@ -242,7 +242,7 @@ struct draw_context
       unsigned eltSize;
 
       /** vertex arrays */
-      const void *vbuffer[PIPE_ATTRIB_MAX];
+      const void *vbuffer[PIPE_MAX_ATTRIBS];
 
       /** constant buffer (for vertex shader) */
       const void *constants;
@@ -275,9 +275,9 @@ struct draw_context
    /* Vertex fetch internal state
     */
    struct {
-      const ubyte *src_ptr[PIPE_ATTRIB_MAX];
-      unsigned pitch[PIPE_ATTRIB_MAX];
-      fetch_func fetch[PIPE_ATTRIB_MAX];
+      const ubyte *src_ptr[PIPE_MAX_ATTRIBS];
+      unsigned pitch[PIPE_MAX_ATTRIBS];
+      fetch_func fetch[PIPE_MAX_ATTRIBS];
       unsigned nr_attrs;
       full_fetch_func fetch_func;
       pt_fetch_func pt_fetch;
index 64ef83d..9b098bc 100644 (file)
@@ -78,7 +78,7 @@ struct fetch_emit_middle_end {
       unsigned pitch;
       void (*fetch)( const void *from, float *attrib);
       void (*emit)( const float *attrib, float **out );
-   } fetch[PIPE_ATTRIB_MAX];
+   } fetch[PIPE_MAX_ATTRIBS];
    
    unsigned nr_fetch;
    unsigned hw_vertex_size;
index f4e29a6..7bb34ac 100644 (file)
@@ -158,7 +158,7 @@ draw_vf_set_vertex_attributes( struct draw_vertex_fetch *vf,
    unsigned offset = 0;
    unsigned i, j;
 
-   assert(nr < PIPE_ATTRIB_MAX);
+   assert(nr < PIPE_MAX_ATTRIBS);
 
    for (j = 0, i = 0; i < nr; i++) {
       const unsigned format = map[i].format;
@@ -390,7 +390,7 @@ struct draw_vertex_fetch *draw_vf_create( void )
    struct draw_vertex_fetch *vf = CALLOC_STRUCT(draw_vertex_fetch);
    unsigned i;
 
-   for (i = 0; i < PIPE_ATTRIB_MAX; i++)
+   for (i = 0; i < PIPE_MAX_ATTRIBS; i++)
       vf->attr[i].vf = vf;
 
    vf->identity[0] = 0.0;
index 011c8f0..7555d1b 100644 (file)
@@ -169,7 +169,7 @@ struct draw_vf_attr
 
 struct draw_vertex_fetch
 {
-   struct draw_vf_attr attr[PIPE_ATTRIB_MAX];
+   struct draw_vf_attr attr[PIPE_MAX_ATTRIBS];
    unsigned attr_count;
    unsigned vertex_stride;
 
index 4e2fa72..487d0ea 100644 (file)
@@ -99,8 +99,8 @@ vs_exec_run( struct draw_vertex_shader *shader,
    struct tgsi_exec_machine *machine = &draw->machine;
    unsigned int j;
 
-   ALIGN16_DECL(struct tgsi_exec_vector, inputs, PIPE_ATTRIB_MAX);
-   ALIGN16_DECL(struct tgsi_exec_vector, outputs, PIPE_ATTRIB_MAX);
+   ALIGN16_DECL(struct tgsi_exec_vector, inputs, PIPE_MAX_ATTRIBS);
+   ALIGN16_DECL(struct tgsi_exec_vector, outputs, PIPE_MAX_ATTRIBS);
    const float *scale = draw->viewport.scale;
    const float *trans = draw->viewport.translate;
 
index bd983f2..d29cb18 100644 (file)
@@ -107,8 +107,8 @@ vs_llvm_run( struct draw_vertex_shader *base,
    struct tgsi_exec_machine *machine = &draw->machine;
    unsigned int j;
 
-   ALIGN16_DECL(struct tgsi_exec_vector, inputs, PIPE_ATTRIB_MAX);
-   ALIGN16_DECL(struct tgsi_exec_vector, outputs, PIPE_ATTRIB_MAX);
+   ALIGN16_DECL(struct tgsi_exec_vector, inputs, PIPE_MAX_ATTRIBS);
+   ALIGN16_DECL(struct tgsi_exec_vector, outputs, PIPE_MAX_ATTRIBS);
    const float *scale = draw->viewport.scale;
    const float *trans = draw->viewport.translate;
 
index a4503c1..bc910dc 100644 (file)
@@ -114,8 +114,8 @@ vs_sse_run( struct draw_vertex_shader *base,
    struct tgsi_exec_machine *machine = &draw->machine;
    unsigned int j;
 
-   ALIGN16_DECL(struct tgsi_exec_vector, inputs, PIPE_ATTRIB_MAX);
-   ALIGN16_DECL(struct tgsi_exec_vector, outputs, PIPE_ATTRIB_MAX);
+   ALIGN16_DECL(struct tgsi_exec_vector, inputs, PIPE_MAX_ATTRIBS);
+   ALIGN16_DECL(struct tgsi_exec_vector, outputs, PIPE_MAX_ATTRIBS);
    const float *scale = draw->viewport.scale;
    const float *trans = draw->viewport.translate;
 
index 0442abd..7f656a9 100644 (file)
@@ -103,8 +103,8 @@ struct cell_context
    struct cell_texture *texture[PIPE_MAX_SAMPLERS];
    uint num_textures;
    struct pipe_viewport_state viewport;
-   struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];
-   struct pipe_vertex_element vertex_element[PIPE_ATTRIB_MAX];
+   struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
+   struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS];
 
    ubyte *cbuf_map[PIPE_MAX_COLOR_BUFS];
    ubyte *zsbuf_map;
@@ -141,7 +141,7 @@ struct cell_context
 
 
    struct spe_function attrib_fetch;
-   unsigned attrib_fetch_offsets[PIPE_ATTRIB_MAX];
+   unsigned attrib_fetch_offsets[PIPE_MAX_ATTRIBS];
 };
 
 
index c839fb4..b896252 100644 (file)
@@ -123,7 +123,7 @@ cell_draw_elements(struct pipe_context *pipe,
    /*
     * Map vertex buffers
     */
-   for (i = 0; i < PIPE_ATTRIB_MAX; i++) {
+   for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
       if (sp->vertex_buffer[i].buffer) {
          void *buf = pipe->winsys->buffer_map(pipe->winsys,
                                               sp->vertex_buffer[i].buffer,
@@ -151,7 +151,7 @@ cell_draw_elements(struct pipe_context *pipe,
    /*
     * unmap vertex/index buffers - will cause draw module to flush
     */
-   for (i = 0; i < PIPE_ATTRIB_MAX; i++) {
+   for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
       if (sp->vertex_buffer[i].buffer) {
          draw_set_mapped_vertex_buffer(draw, i, NULL);
          pipe->winsys->buffer_unmap(pipe->winsys, sp->vertex_buffer[i].buffer);
index 563831b..37d25fb 100644 (file)
@@ -41,7 +41,7 @@ cell_set_vertex_element(struct pipe_context *pipe,
                             const struct pipe_vertex_element *attrib)
 {
    struct cell_context *cell = cell_context(pipe);
-   assert(index < PIPE_ATTRIB_MAX);
+   assert(index < PIPE_MAX_ATTRIBS);
    cell->vertex_element[index] = *attrib; /* struct copy */
    cell->dirty |= CELL_NEW_VERTEX;
 
@@ -55,7 +55,7 @@ cell_set_vertex_buffer(struct pipe_context *pipe,
                            const struct pipe_vertex_buffer *buffer)
 {
    struct cell_context *cell = cell_context(pipe);
-   assert(index < PIPE_ATTRIB_MAX);
+   assert(index < PIPE_MAX_ATTRIBS);
    cell->vertex_buffer[index] = *buffer; /* struct copy */
    cell->dirty |= CELL_NEW_VERTEX;
 
index 4828a80..49d5443 100644 (file)
@@ -263,7 +263,7 @@ void cell_update_vertex_fetch(struct draw_context *draw)
    struct cell_context *const cell =
        (struct cell_context *) draw->driver_private;
    struct spe_function *p = &cell->attrib_fetch;
-   unsigned function_index[PIPE_ATTRIB_MAX];
+   unsigned function_index[PIPE_MAX_ATTRIBS];
    unsigned unique_attr_formats;
    int out_ptr;
    int in_ptr;
index fccff01..d7f46f8 100644 (file)
@@ -55,7 +55,7 @@ struct spu_global spu;
 
 struct spu_vs_context draw;
 
-static unsigned char attribute_fetch_code_buffer[136 * PIPE_ATTRIB_MAX]
+static unsigned char attribute_fetch_code_buffer[136 * PIPE_MAX_ATTRIBS]
     ALIGN16_ATTRIB;
 
 static unsigned char depth_stencil_code_buffer[4 * 64]
@@ -361,7 +361,7 @@ cmd_state_vs_array_info(const struct cell_array_info *vs_info)
 {
    const unsigned attr = vs_info->attr;
 
-   ASSERT(attr < PIPE_ATTRIB_MAX);
+   ASSERT(attr < PIPE_MAX_ATTRIBS);
    draw.vertex_fetch.src_ptr[attr] = vs_info->base;
    draw.vertex_fetch.pitch[attr] = vs_info->pitch;
    draw.vertex_fetch.size[attr] = vs_info->size;
index 8363efe..3119a78 100644 (file)
@@ -86,8 +86,8 @@ run_vertex_program(struct spu_vs_context *draw,
    struct spu_exec_machine *machine = &draw->machine;
    unsigned int j;
 
-   ALIGN16_DECL(struct spu_exec_vector, inputs, PIPE_ATTRIB_MAX);
-   ALIGN16_DECL(struct spu_exec_vector, outputs, PIPE_ATTRIB_MAX);
+   ALIGN16_DECL(struct spu_exec_vector, inputs, PIPE_MAX_ATTRIBS);
+   ALIGN16_DECL(struct spu_exec_vector, outputs, PIPE_MAX_ATTRIBS);
    const float *scale = draw->viewport.scale;
    const float *trans = draw->viewport.translate;
 
index 54a4b8d..4c74f5e 100644 (file)
@@ -16,10 +16,10 @@ struct spu_vs_context {
    struct pipe_viewport_state viewport;
 
    struct {
-      uint64_t src_ptr[PIPE_ATTRIB_MAX];
-      unsigned pitch[PIPE_ATTRIB_MAX];
-      unsigned size[PIPE_ATTRIB_MAX];
-      unsigned code_offset[PIPE_ATTRIB_MAX];
+      uint64_t src_ptr[PIPE_MAX_ATTRIBS];
+      unsigned pitch[PIPE_MAX_ATTRIBS];
+      unsigned size[PIPE_MAX_ATTRIBS];
+      unsigned code_offset[PIPE_MAX_ATTRIBS];
       unsigned nr_attrs;
       boolean dirty;
 
index 8f3ad3e..4afe10c 100644 (file)
@@ -84,8 +84,8 @@ struct failover_context {
    struct pipe_scissor_state scissor;
    struct pipe_texture *texture[PIPE_MAX_SAMPLERS];
    struct pipe_viewport_state viewport;
-   struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];
-   struct pipe_vertex_element vertex_element[PIPE_ATTRIB_MAX];
+   struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
+   struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS];
 
    void *sw_sampler_state[PIPE_MAX_SAMPLERS];
    void *hw_sampler_state[PIPE_MAX_SAMPLERS];
index 3de931e..bb89f92 100644 (file)
@@ -104,7 +104,7 @@ failover_state_emit( struct failover_context *failover )
    }
 
    if (failover->dirty & FO_NEW_VERTEX_BUFFER) {
-      for (i = 0; i < PIPE_ATTRIB_MAX; i++) {
+      for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
         if (failover->dirty_vertex_buffer & (1<<i)) {
            failover->sw->set_vertex_buffer( failover->sw, i, 
                                             &failover->vertex_buffer[i] );
@@ -113,7 +113,7 @@ failover_state_emit( struct failover_context *failover )
    }
 
    if (failover->dirty & FO_NEW_VERTEX_ELEMENT) {
-      for (i = 0; i < PIPE_ATTRIB_MAX; i++) {
+      for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
         if (failover->dirty_vertex_element & (1<<i)) {
            failover->sw->set_vertex_element( failover->sw, i, 
                                              &failover->vertex_element[i] );
index 15ff236..fee33d8 100644 (file)
@@ -65,7 +65,7 @@ i915_draw_elements( struct pipe_context *pipe,
    /*
     * Map vertex buffers
     */
-   for (i = 0; i < PIPE_ATTRIB_MAX; i++) {
+   for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
       if (i915->vertex_buffer[i].buffer) {
          void *buf
             = pipe->winsys->buffer_map(pipe->winsys,
@@ -96,7 +96,7 @@ i915_draw_elements( struct pipe_context *pipe,
    /*
     * unmap vertex/index buffers
     */
-   for (i = 0; i < PIPE_ATTRIB_MAX; i++) {
+   for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
       if (i915->vertex_buffer[i].buffer) {
          pipe->winsys->buffer_unmap(pipe->winsys, i915->vertex_buffer[i].buffer);
          draw_set_mapped_vertex_buffer(draw, i, NULL);
index 746f18b..8e707ea 100644 (file)
@@ -232,7 +232,7 @@ struct i915_context
    struct pipe_scissor_state scissor;\r
    struct i915_texture *texture[PIPE_MAX_SAMPLERS];\r
    struct pipe_viewport_state viewport;\r
-   struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];\r
+   struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];\r
 \r
    unsigned dirty;\r
 \r
index a89d08b..d70fc09 100644 (file)
@@ -116,7 +116,7 @@ struct brw_clip_compile {
    unsigned last_mrf;
 
    unsigned header_position_offset;
-   unsigned offset[PIPE_ATTRIB_MAX];
+   unsigned offset[PIPE_MAX_ATTRIBS];
 };
 
 #define ATTR_SIZE  (4*4)
index b83a13c..0c96ba1 100644 (file)
@@ -433,17 +433,17 @@ struct brw_cached_batch_item {
 \r
 \r
 \r
-/* Protect against a future where PIPE_ATTRIB_MAX > 32.  Wouldn't life\r
+/* Protect against a future where PIPE_MAX_ATTRIBS > 32.  Wouldn't life\r
  * be easier if C allowed arrays of packed elements?\r
  */\r
-#define ATTRIB_BIT_DWORDS  ((PIPE_ATTRIB_MAX+31)/32)\r
+#define ATTRIB_BIT_DWORDS  ((PIPE_MAX_ATTRIBS+31)/32)\r
 \r
 \r
 \r
 \r
 struct brw_vertex_info {\r
-   unsigned varying;  /* varying:1[PIPE_ATTRIB_MAX] */\r
-   unsigned sizes[ATTRIB_BIT_DWORDS * 2]; /* sizes:2[PIPE_ATTRIB_MAX] */\r
+   unsigned varying;  /* varying:1[PIPE_MAX_ATTRIBS] */\r
+   unsigned sizes[ATTRIB_BIT_DWORDS * 2]; /* sizes:2[PIPE_MAX_ATTRIBS] */\r
 };\r
 \r
 \r
@@ -496,9 +496,9 @@ struct brw_context
       /* Arrays with buffer objects to copy non-bufferobj arrays into\r
        * for upload:\r
        */\r
-      const struct pipe_vertex_buffer *vbo_array[PIPE_ATTRIB_MAX];\r
+      const struct pipe_vertex_buffer *vbo_array[PIPE_MAX_ATTRIBS];\r
 \r
-      struct brw_vertex_element_state inputs[PIPE_ATTRIB_MAX];\r
+      struct brw_vertex_element_state inputs[PIPE_MAX_ATTRIBS];\r
 \r
 #define BRW_NR_UPLOAD_BUFS 17\r
 #define BRW_UPLOAD_INIT_SIZE (128*1024)\r
index f5efe9f..0d04a8a 100644 (file)
@@ -292,7 +292,7 @@ static void brw_set_vertex_element(struct pipe_context *pipe,
    /* flush ? */\r
    struct brw_context *brw = brw_context(pipe);\r
 \r
-   assert(index < PIPE_ATTRIB_MAX);\r
+   assert(index < PIPE_MAX_ATTRIBS);\r
    struct brw_vertex_element_state el;\r
    memset(&el, 0, sizeof(el));\r
 \r
index a1ac0f5..b29c439 100644 (file)
@@ -76,7 +76,7 @@ struct brw_wm_prog_key {
 
 #define PROGRAM_INTERNAL_PARAM
 #define MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS 1024 /* 72 for GL_ARB_f_p */
-#define BRW_WM_MAX_INSN  (MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS*3 + PIPE_ATTRIB_MAX + 3)
+#define BRW_WM_MAX_INSN  (MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS*3 + PIPE_MAX_ATTRIBS + 3)
 #define BRW_WM_MAX_GRF   128           /* hardware limit */
 #define BRW_WM_MAX_VREG  (BRW_WM_MAX_INSN * 4)
 #define BRW_WM_MAX_REF   (BRW_WM_MAX_INSN * 12)
@@ -84,7 +84,7 @@ struct brw_wm_prog_key {
 #define BRW_WM_MAX_CONST 256
 #define BRW_WM_MAX_KILLS MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS
 
-#define PAYLOAD_DEPTH     (PIPE_ATTRIB_MAX)
+#define PAYLOAD_DEPTH     (PIPE_MAX_ATTRIBS)
 
 #define MAX_IFSN 32
 #define MAX_LOOP_DEPTH 32
index 19e6cfa..dc9d0e6 100644 (file)
@@ -77,8 +77,8 @@ struct softpipe_context {
    struct pipe_scissor_state scissor;
    struct pipe_texture *texture[PIPE_MAX_SAMPLERS];
    struct pipe_viewport_state viewport;
-   struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];
-   struct pipe_vertex_element vertex_element[PIPE_ATTRIB_MAX];
+   struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
+   struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS];
    unsigned dirty;
 
    unsigned num_samplers;
@@ -92,7 +92,7 @@ struct softpipe_context {
    /*
     * Mapped vertex buffers
     */
-   ubyte *mapped_vbuffer[PIPE_ATTRIB_MAX];
+   ubyte *mapped_vbuffer[PIPE_MAX_ATTRIBS];
    
    /** Mapped constant buffers */
    void *mapped_constants[PIPE_SHADER_TYPES];
index 5b5a0fe..ab54050 100644 (file)
@@ -125,7 +125,7 @@ softpipe_draw_elements(struct pipe_context *pipe,
    /*
     * Map vertex buffers
     */
-   for (i = 0; i < PIPE_ATTRIB_MAX; i++) {
+   for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
       if (sp->vertex_buffer[i].buffer) {
          void *buf
             = pipe->winsys->buffer_map(pipe->winsys,
@@ -153,7 +153,7 @@ softpipe_draw_elements(struct pipe_context *pipe,
    /*
     * unmap vertex/index buffers - will cause draw module to flush
     */
-   for (i = 0; i < PIPE_ATTRIB_MAX; i++) {
+   for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
       if (sp->vertex_buffer[i].buffer) {
          draw_set_mapped_vertex_buffer(draw, i, NULL);
          pipe->winsys->buffer_unmap(pipe->winsys, sp->vertex_buffer[i].buffer);
index 8612851..c10ad80 100644 (file)
@@ -185,8 +185,8 @@ struct quad_stage *sp_quad_shade_stage( struct softpipe_context *softpipe )
    uint i;
 
    /* allocate storage for program inputs/outputs, aligned to 16 bytes */
-   qss->inputs = MALLOC(PIPE_ATTRIB_MAX * sizeof(*qss->inputs) + 16);
-   qss->outputs = MALLOC(PIPE_ATTRIB_MAX * sizeof(*qss->outputs) + 16);
+   qss->inputs = MALLOC(PIPE_MAX_ATTRIBS * sizeof(*qss->inputs) + 16);
+   qss->outputs = MALLOC(PIPE_MAX_ATTRIBS * sizeof(*qss->outputs) + 16);
    qss->machine.Inputs = align16(qss->inputs);
    qss->machine.Outputs = align16(qss->outputs);
 
index f01a10d..c054e76 100644 (file)
@@ -42,7 +42,7 @@ softpipe_set_vertex_element(struct pipe_context *pipe,
                             const struct pipe_vertex_element *attrib)
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
-   assert(index < PIPE_ATTRIB_MAX);
+   assert(index < PIPE_MAX_ATTRIBS);
    softpipe->vertex_element[index] = *attrib; /* struct copy */
    softpipe->dirty |= SP_NEW_VERTEX;
 
@@ -56,7 +56,7 @@ softpipe_set_vertex_buffer(struct pipe_context *pipe,
                            const struct pipe_vertex_buffer *buffer)
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
-   assert(index < PIPE_ATTRIB_MAX);
+   assert(index < PIPE_MAX_ATTRIBS);
    softpipe->vertex_buffer[index] = *buffer; /* struct copy */
    softpipe->dirty |= SP_NEW_VERTEX;
 
index a2bd8c6..2490412 100644 (file)
@@ -54,7 +54,8 @@ extern "C" {
 #define PIPE_MAX_SAMPLERS     8
 #define PIPE_MAX_CLIP_PLANES  6
 #define PIPE_MAX_CONSTANT    32
-#define PIPE_ATTRIB_MAX      32
+#define PIPE_MAX_ATTRIBS     32
+#define PIPE_ATTRIB_MAX      32 /* XXX obsolete - remove */
 #define PIPE_MAX_COLOR_BUFS   8
 #define PIPE_MAX_TEXTURE_LEVELS  16
 #define PIPE_MAX_FEEDBACK_ATTRIBS 16
index 20af90d..4aca331 100644 (file)
@@ -606,7 +606,7 @@ st_feedback_draw_vbo(GLcontext *ctx,
    /*
     * unmap vertex/index buffers
     */
-   for (i = 0; i < PIPE_ATTRIB_MAX; i++) {
+   for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
       if (draw->vertex_buffer[i].buffer) {
          pipe->winsys->buffer_unmap(pipe->winsys,
                                     draw->vertex_buffer[i].buffer);