summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/auxiliary/draw/draw_context.c4
-rw-r--r--src/gallium/auxiliary/draw/draw_private.h12
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_emit.c2
-rw-r--r--src/gallium/auxiliary/draw/draw_vf.c4
-rw-r--r--src/gallium/auxiliary/draw/draw_vf.h2
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_exec.c4
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_llvm.c4
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_sse.c4
-rw-r--r--src/gallium/drivers/cell/ppu/cell_context.h6
-rw-r--r--src/gallium/drivers/cell/ppu/cell_draw_arrays.c4
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_vertex.c4
-rw-r--r--src/gallium/drivers/cell/ppu/cell_vertex_fetch.c2
-rw-r--r--src/gallium/drivers/cell/spu/spu_main.c4
-rw-r--r--src/gallium/drivers/cell/spu/spu_vertex_shader.c4
-rw-r--r--src/gallium/drivers/cell/spu/spu_vertex_shader.h8
-rw-r--r--src/gallium/drivers/failover/fo_context.h4
-rw-r--r--src/gallium/drivers/failover/fo_state_emit.c4
-rw-r--r--src/gallium/drivers/i915simple/i915_context.c4
-rw-r--r--src/gallium/drivers/i915simple/i915_context.h2
-rw-r--r--src/gallium/drivers/i965simple/brw_clip.h2
-rw-r--r--src/gallium/drivers/i965simple/brw_context.h12
-rw-r--r--src/gallium/drivers/i965simple/brw_state.c2
-rw-r--r--src/gallium/drivers/i965simple/brw_wm.h4
-rw-r--r--src/gallium/drivers/softpipe/sp_context.h6
-rw-r--r--src/gallium/drivers/softpipe/sp_draw_arrays.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_fs.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_state_vertex.c4
-rw-r--r--src/gallium/include/pipe/p_state.h3
-rw-r--r--src/mesa/state_tracker/st_draw.c2
29 files changed, 63 insertions, 62 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index 903cc267662..81858e01cac 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -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;
}
diff --git a/src/gallium/auxiliary/draw/draw_private.h b/src/gallium/auxiliary/draw/draw_private.h
index 7007ee22c4d..8eb2f515cbc 100644
--- a/src/gallium/auxiliary/draw/draw_private.h
+++ b/src/gallium/auxiliary/draw/draw_private.h
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c
index 64ef83d8001..9b098bc173f 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_vf.c b/src/gallium/auxiliary/draw/draw_vf.c
index f4e29a62932..7bb34ace7aa 100644
--- a/src/gallium/auxiliary/draw/draw_vf.c
+++ b/src/gallium/auxiliary/draw/draw_vf.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_vf.h b/src/gallium/auxiliary/draw/draw_vf.h
index 011c8f0ff1c..7555d1bd588 100644
--- a/src/gallium/auxiliary/draw/draw_vf.h
+++ b/src/gallium/auxiliary/draw/draw_vf.h
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_vs_exec.c b/src/gallium/auxiliary/draw/draw_vs_exec.c
index 4e2fa727070..487d0ea7f4f 100644
--- a/src/gallium/auxiliary/draw/draw_vs_exec.c
+++ b/src/gallium/auxiliary/draw/draw_vs_exec.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_vs_llvm.c b/src/gallium/auxiliary/draw/draw_vs_llvm.c
index bd983f2ddfa..d29cb18efe4 100644
--- a/src/gallium/auxiliary/draw/draw_vs_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_vs_llvm.c
@@ -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;
diff --git a/src/gallium/auxiliary/draw/draw_vs_sse.c b/src/gallium/auxiliary/draw/draw_vs_sse.c
index a4503c143ed..bc910dc2d04 100644
--- a/src/gallium/auxiliary/draw/draw_vs_sse.c
+++ b/src/gallium/auxiliary/draw/draw_vs_sse.c
@@ -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;
diff --git a/src/gallium/drivers/cell/ppu/cell_context.h b/src/gallium/drivers/cell/ppu/cell_context.h
index 0442abddc18..7f656a97447 100644
--- a/src/gallium/drivers/cell/ppu/cell_context.h
+++ b/src/gallium/drivers/cell/ppu/cell_context.h
@@ -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];
};
diff --git a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c
index c839fb4d12d..b896252f817 100644
--- a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c
+++ b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c
@@ -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);
diff --git a/src/gallium/drivers/cell/ppu/cell_state_vertex.c b/src/gallium/drivers/cell/ppu/cell_state_vertex.c
index 563831b62db..37d25fb3578 100644
--- a/src/gallium/drivers/cell/ppu/cell_state_vertex.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_vertex.c
@@ -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;
diff --git a/src/gallium/drivers/cell/ppu/cell_vertex_fetch.c b/src/gallium/drivers/cell/ppu/cell_vertex_fetch.c
index 4828a8023bd..49d5443cde7 100644
--- a/src/gallium/drivers/cell/ppu/cell_vertex_fetch.c
+++ b/src/gallium/drivers/cell/ppu/cell_vertex_fetch.c
@@ -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;
diff --git a/src/gallium/drivers/cell/spu/spu_main.c b/src/gallium/drivers/cell/spu/spu_main.c
index fccff01e108..d7f46f80246 100644
--- a/src/gallium/drivers/cell/spu/spu_main.c
+++ b/src/gallium/drivers/cell/spu/spu_main.c
@@ -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;
diff --git a/src/gallium/drivers/cell/spu/spu_vertex_shader.c b/src/gallium/drivers/cell/spu/spu_vertex_shader.c
index 8363efeeb6e..3119a78c060 100644
--- a/src/gallium/drivers/cell/spu/spu_vertex_shader.c
+++ b/src/gallium/drivers/cell/spu/spu_vertex_shader.c
@@ -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;
diff --git a/src/gallium/drivers/cell/spu/spu_vertex_shader.h b/src/gallium/drivers/cell/spu/spu_vertex_shader.h
index 54a4b8d9b9f..4c74f5e74d5 100644
--- a/src/gallium/drivers/cell/spu/spu_vertex_shader.h
+++ b/src/gallium/drivers/cell/spu/spu_vertex_shader.h
@@ -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;
diff --git a/src/gallium/drivers/failover/fo_context.h b/src/gallium/drivers/failover/fo_context.h
index 8f3ad3ee798..4afe10c4b86 100644
--- a/src/gallium/drivers/failover/fo_context.h
+++ b/src/gallium/drivers/failover/fo_context.h
@@ -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];
diff --git a/src/gallium/drivers/failover/fo_state_emit.c b/src/gallium/drivers/failover/fo_state_emit.c
index 3de931e04eb..bb89f925e93 100644
--- a/src/gallium/drivers/failover/fo_state_emit.c
+++ b/src/gallium/drivers/failover/fo_state_emit.c
@@ -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] );
diff --git a/src/gallium/drivers/i915simple/i915_context.c b/src/gallium/drivers/i915simple/i915_context.c
index 15ff2360b74..fee33d82de4 100644
--- a/src/gallium/drivers/i915simple/i915_context.c
+++ b/src/gallium/drivers/i915simple/i915_context.c
@@ -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);
diff --git a/src/gallium/drivers/i915simple/i915_context.h b/src/gallium/drivers/i915simple/i915_context.h
index 746f18ba38d..8e707ea574a 100644
--- a/src/gallium/drivers/i915simple/i915_context.h
+++ b/src/gallium/drivers/i915simple/i915_context.h
@@ -232,7 +232,7 @@ struct i915_context
struct pipe_scissor_state scissor;
struct i915_texture *texture[PIPE_MAX_SAMPLERS];
struct pipe_viewport_state viewport;
- struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];
+ struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
unsigned dirty;
diff --git a/src/gallium/drivers/i965simple/brw_clip.h b/src/gallium/drivers/i965simple/brw_clip.h
index a89d08b7910..d70fc094ff5 100644
--- a/src/gallium/drivers/i965simple/brw_clip.h
+++ b/src/gallium/drivers/i965simple/brw_clip.h
@@ -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)
diff --git a/src/gallium/drivers/i965simple/brw_context.h b/src/gallium/drivers/i965simple/brw_context.h
index b83a13c3b6b..0c96ba17327 100644
--- a/src/gallium/drivers/i965simple/brw_context.h
+++ b/src/gallium/drivers/i965simple/brw_context.h
@@ -433,17 +433,17 @@ struct brw_cached_batch_item {
-/* Protect against a future where PIPE_ATTRIB_MAX > 32. Wouldn't life
+/* Protect against a future where PIPE_MAX_ATTRIBS > 32. Wouldn't life
* be easier if C allowed arrays of packed elements?
*/
-#define ATTRIB_BIT_DWORDS ((PIPE_ATTRIB_MAX+31)/32)
+#define ATTRIB_BIT_DWORDS ((PIPE_MAX_ATTRIBS+31)/32)
struct brw_vertex_info {
- unsigned varying; /* varying:1[PIPE_ATTRIB_MAX] */
- unsigned sizes[ATTRIB_BIT_DWORDS * 2]; /* sizes:2[PIPE_ATTRIB_MAX] */
+ unsigned varying; /* varying:1[PIPE_MAX_ATTRIBS] */
+ unsigned sizes[ATTRIB_BIT_DWORDS * 2]; /* sizes:2[PIPE_MAX_ATTRIBS] */
};
@@ -496,9 +496,9 @@ struct brw_context
/* Arrays with buffer objects to copy non-bufferobj arrays into
* for upload:
*/
- const struct pipe_vertex_buffer *vbo_array[PIPE_ATTRIB_MAX];
+ const struct pipe_vertex_buffer *vbo_array[PIPE_MAX_ATTRIBS];
- struct brw_vertex_element_state inputs[PIPE_ATTRIB_MAX];
+ struct brw_vertex_element_state inputs[PIPE_MAX_ATTRIBS];
#define BRW_NR_UPLOAD_BUFS 17
#define BRW_UPLOAD_INIT_SIZE (128*1024)
diff --git a/src/gallium/drivers/i965simple/brw_state.c b/src/gallium/drivers/i965simple/brw_state.c
index f5efe9fc06d..0d04a8a5947 100644
--- a/src/gallium/drivers/i965simple/brw_state.c
+++ b/src/gallium/drivers/i965simple/brw_state.c
@@ -292,7 +292,7 @@ static void brw_set_vertex_element(struct pipe_context *pipe,
/* flush ? */
struct brw_context *brw = brw_context(pipe);
- assert(index < PIPE_ATTRIB_MAX);
+ assert(index < PIPE_MAX_ATTRIBS);
struct brw_vertex_element_state el;
memset(&el, 0, sizeof(el));
diff --git a/src/gallium/drivers/i965simple/brw_wm.h b/src/gallium/drivers/i965simple/brw_wm.h
index a1ac0f504a6..b29c4393f01 100644
--- a/src/gallium/drivers/i965simple/brw_wm.h
+++ b/src/gallium/drivers/i965simple/brw_wm.h
@@ -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
diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h
index 19e6cfaf02e..dc9d0e6d5d6 100644
--- a/src/gallium/drivers/softpipe/sp_context.h
+++ b/src/gallium/drivers/softpipe/sp_context.h
@@ -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];
diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c
index 5b5a0fe5735..ab54050d3fe 100644
--- a/src/gallium/drivers/softpipe/sp_draw_arrays.c
+++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c
@@ -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);
diff --git a/src/gallium/drivers/softpipe/sp_quad_fs.c b/src/gallium/drivers/softpipe/sp_quad_fs.c
index 861285101fd..c10ad80e015 100644
--- a/src/gallium/drivers/softpipe/sp_quad_fs.c
+++ b/src/gallium/drivers/softpipe/sp_quad_fs.c
@@ -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);
diff --git a/src/gallium/drivers/softpipe/sp_state_vertex.c b/src/gallium/drivers/softpipe/sp_state_vertex.c
index f01a10de3b4..c054e76d9be 100644
--- a/src/gallium/drivers/softpipe/sp_state_vertex.c
+++ b/src/gallium/drivers/softpipe/sp_state_vertex.c
@@ -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;
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index a2bd8c6aaab..2490412126f 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -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
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 20af90df7d8..4aca3311b7b 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -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);