gallium: Rename PIPE_MAX_CONSTANT to PIPE_MAX_CONSTANT_BUFFERS.
authorMichal Krol <michal@vmware.com>
Mon, 25 Jan 2010 12:29:33 +0000 (13:29 +0100)
committerMichal Krol <michal@vmware.com>
Thu, 28 Jan 2010 13:08:03 +0000 (14:08 +0100)
21 files changed:
src/gallium/auxiliary/draw/draw_context.c
src/gallium/auxiliary/draw/draw_gs.c
src/gallium/auxiliary/draw/draw_gs.h
src/gallium/auxiliary/draw/draw_private.h
src/gallium/auxiliary/draw/draw_vs.c
src/gallium/auxiliary/draw/draw_vs.h
src/gallium/auxiliary/draw/draw_vs_aos.c
src/gallium/auxiliary/draw/draw_vs_aos.h
src/gallium/auxiliary/draw/draw_vs_exec.c
src/gallium/auxiliary/draw/draw_vs_llvm.c
src/gallium/auxiliary/draw/draw_vs_ppc.c
src/gallium/auxiliary/draw/draw_vs_sse.c
src/gallium/auxiliary/tgsi/tgsi_exec.c
src/gallium/auxiliary/tgsi/tgsi_exec.h
src/gallium/auxiliary/tgsi/tgsi_ureg.c
src/gallium/drivers/softpipe/sp_context.c
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_fs.c
src/gallium/include/pipe/p_state.h

index a52b93e12298e5255ba50c3d547b4d0c79ce1eef..d3084fd428390e19424b0a8c63ddf8c0657a0471 100644 (file)
@@ -240,7 +240,7 @@ draw_set_mapped_constant_buffer(struct draw_context *draw,
 {
    debug_assert(shader_type == PIPE_SHADER_VERTEX ||
                 shader_type == PIPE_SHADER_GEOMETRY);
-   debug_assert(slot < PIPE_MAX_CONSTANT);
+   debug_assert(slot < PIPE_MAX_CONSTANT_BUFFERS);
 
    if (shader_type == PIPE_SHADER_VERTEX) {
       draw->pt.user.vs_constants[slot] = buffer;
index 96be5dba0b3d9d21c33647c51b9c7166756fcdb3..7069aa6b181cc2f2ee5d0456b530f3c5b2d755c3 100644 (file)
@@ -293,7 +293,7 @@ draw_geometry_fetch_outputs(struct draw_geometry_shader *shader,
 void draw_geometry_shader_run(struct draw_geometry_shader *shader,
                               const float (*input)[4],
                               float (*output)[4],
-                              const void *constants[PIPE_MAX_CONSTANT],
+                              const void *constants[PIPE_MAX_CONSTANT_BUFFERS],
                               unsigned count,
                               unsigned input_stride,
                               unsigned vertex_size)
@@ -304,7 +304,7 @@ void draw_geometry_shader_run(struct draw_geometry_shader *shader,
    unsigned num_primitives = count/num_vertices;
    unsigned inputs_from_vs = 0;
 
-   for (i = 0; i < PIPE_MAX_CONSTANT; i++) {
+   for (i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; i++) {
       machine->Consts[i] = constants[i];
    }
 
index e055c8a05c2966240479bc0405d7f19a7308ca35..d8eb2103433e79fcee013fc3c0b021e60cf8360f 100644 (file)
@@ -62,7 +62,7 @@ struct draw_geometry_shader {
 void draw_geometry_shader_run(struct draw_geometry_shader *shader,
                               const float (*input)[4],
                               float (*output)[4],
-                              const void *constants[PIPE_MAX_CONSTANT],
+                              const void *constants[PIPE_MAX_CONSTANT_BUFFERS],
                               unsigned count,
                               unsigned input_stride,
                               unsigned output_stride);
index ecb17cbbe2fe1114340b2940d2adb8eb6eea193c..6a7190e9750b0985e6b02a14677223d106a99b76 100644 (file)
@@ -153,8 +153,8 @@ struct draw_context
          const void *vbuffer[PIPE_MAX_ATTRIBS];
          
          /** constant buffer (for vertex/geometry shader) */
-         const void *vs_constants[PIPE_MAX_CONSTANT];
-         const void *gs_constants[PIPE_MAX_CONSTANT];
+         const void *vs_constants[PIPE_MAX_CONSTANT_BUFFERS];
+         const void *gs_constants[PIPE_MAX_CONSTANT_BUFFERS];
       } user;
 
       boolean test_fse;         /* enable FSE even though its not correct (eg for softpipe) */
@@ -202,10 +202,10 @@ struct draw_context
       struct aos_machine *aos_machine; 
 
 
-      const void *aligned_constants[PIPE_MAX_CONSTANT];
+      const void *aligned_constants[PIPE_MAX_CONSTANT_BUFFERS];
 
-      const void *aligned_constant_storage[PIPE_MAX_CONSTANT];
-      unsigned const_storage_size[PIPE_MAX_CONSTANT];
+      const void *aligned_constant_storage[PIPE_MAX_CONSTANT_BUFFERS];
+      unsigned const_storage_size[PIPE_MAX_CONSTANT_BUFFERS];
 
 
       struct translate *fetch;
index 120b976d9f4661c48c3c523f26d7479b86208b5e..6bdd612e6f436cbdfd88f93c26883780ed588d1c 100644 (file)
@@ -196,7 +196,7 @@ draw_vs_destroy( struct draw_context *draw )
    if (draw->vs.aos_machine)
       draw_vs_aos_machine_destroy(draw->vs.aos_machine);
 
-   for (i = 0; i < PIPE_MAX_CONSTANT; i++) {
+   for (i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; i++) {
       if (draw->vs.aligned_constant_storage[i]) {
          align_free((void *)draw->vs.aligned_constant_storage[i]);
       }
index 6bd3683d39b0a36cc91f24f764180e72b8599c21..d095c9bad1d4b563c167b100bc0c6748f4b4ac7c 100644 (file)
@@ -132,7 +132,7 @@ struct draw_vertex_shader {
    void (*run_linear)( struct draw_vertex_shader *shader,
                       const float (*input)[4],
                       float (*output)[4],
-                      const void *constants[PIPE_MAX_CONSTANT],
+                      const void *constants[PIPE_MAX_CONSTANT_BUFFERS],
                       unsigned count,
                       unsigned input_stride,
                       unsigned output_stride );
index 4d73de413d99c5b0c53651d981de81a169cabbfd..e7121f3654139ce4da701e093a5fe95b7cd9fec2 100644 (file)
@@ -2119,7 +2119,7 @@ static void PIPE_CDECL vaos_run_elts( struct draw_vs_varient *varient,
    if (0) debug_printf("%s %d\n", __FUNCTION__, count);
 
    machine->internal[IMM_PSIZE][0] = vaos->draw->rasterizer->point_size;
-   for (i = 0; i < PIPE_MAX_CONSTANT; i++) {
+   for (i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; i++) {
       machine->constants[i] = vaos->draw->vs.aligned_constants[i];
    }
    machine->immediates = vaos->base.vs->immediates;
@@ -2144,7 +2144,7 @@ static void PIPE_CDECL vaos_run_linear( struct draw_vs_varient *varient,
                        vaos->base.key.const_vbuffers);
 
    machine->internal[IMM_PSIZE][0] = vaos->draw->rasterizer->point_size;
-   for (i = 0; i < PIPE_MAX_CONSTANT; i++) {
+   for (i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; i++) {
       machine->constants[i] = vaos->draw->vs.aligned_constants[i];
    }
    machine->immediates = vaos->base.vs->immediates;
index eefc0974649ebfb726a97ff9682ad618f180ea18..1911242f8254f960a90a1ea45da66d6229b25217 100644 (file)
@@ -122,7 +122,7 @@ struct aos_machine {
    ushort fpucntl;              /* one of FPU_* above */
 
    const float (*immediates)[4];     /* points to shader data */
-   const void *constants[PIPE_MAX_CONSTANT]; /* points to draw data */
+   const void *constants[PIPE_MAX_CONSTANT_BUFFERS]; /* points to draw data */
 
    const struct aos_buffer *buffer; /* points to ? */
 };
index 652c8446543a6a7ecd84623dd97e671307ed586a..7deca2b69d946e9bcdbee454f64a084bbc75c950 100644 (file)
@@ -85,7 +85,7 @@ static void
 vs_exec_run_linear( struct draw_vertex_shader *shader,
                    const float (*input)[4],
                    float (*output)[4],
-                   const void *constants[PIPE_MAX_CONSTANT],
+                   const void *constants[PIPE_MAX_CONSTANT_BUFFERS],
                    unsigned count,
                    unsigned input_stride,
                    unsigned output_stride )
@@ -95,7 +95,7 @@ vs_exec_run_linear( struct draw_vertex_shader *shader,
    unsigned int i, j;
    unsigned slot;
 
-   for (i = 0; i < PIPE_MAX_CONSTANT; i++) {
+   for (i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; i++) {
       machine->Consts[i] = constants[i];
    }
 
index e8e72f06eca9ca31a1f16b08fac24613c86c4a25..fd9166fda588088d7d5a0bd7c8878cbb92823227 100644 (file)
@@ -64,7 +64,7 @@ static void
 vs_llvm_run_linear( struct draw_vertex_shader *base,
                   const float (*input)[4],
                   float (*output)[4],
-                   const void *constants[PIPE_MAX_CONSTANT],
+                   const void *constants[PIPE_MAX_CONSTANT_BUFFERS],
                   unsigned count,
                   unsigned input_stride,
                   unsigned output_stride )
index 9952b40fcc094a650efe458cbf58148995665c5e..d869eecec5e3119a8521a2fbea7e29b6187a8099 100644 (file)
@@ -85,7 +85,7 @@ static void
 vs_ppc_run_linear( struct draw_vertex_shader *base,
                   const float (*input)[4],
                   float (*output)[4],
-                  const void *constants[PIPE_MAX_CONSTANT],
+                  const void *constants[PIPE_MAX_CONSTANT_BUFFERS],
                   unsigned count,
                   unsigned input_stride,
                   unsigned output_stride )
index 297013dc74c8e56bbf2a7ec0ec194c7d9f2def9c..54e6423388f200b9d6e8a32f9bcce01969015581 100644 (file)
@@ -83,7 +83,7 @@ static void
 vs_sse_run_linear( struct draw_vertex_shader *base,
                   const float (*input)[4],
                   float (*output)[4],
-                  const void *constants[PIPE_MAX_CONSTANT],
+                  const void *constants[PIPE_MAX_CONSTANT_BUFFERS],
                   unsigned count,
                   unsigned input_stride,
                   unsigned output_stride )
index 74e7e637cc6913339165454bea2222fd82bbd597..fbb9aa0e63a68b73d4d707b770501d1556321df1 100644 (file)
@@ -965,7 +965,7 @@ fetch_src_file_channel(const struct tgsi_exec_machine *mach,
    switch (file) {
    case TGSI_FILE_CONSTANT:
       for (i = 0; i < QUAD_SIZE; i++) {
-         assert(index2D->i[i] >= 0 && index2D->i[i] < PIPE_MAX_CONSTANT);
+         assert(index2D->i[i] >= 0 && index2D->i[i] < PIPE_MAX_CONSTANT_BUFFERS);
          assert(mach->Consts[index2D->i[i]]);
 
          if (index->i[i] < 0) {
index 1f3e85fb62f4df603e658a6c6498ca0b6ce68c22..a22873e4c2bb0fc2a194c29229817539426aac21 100644 (file)
@@ -260,7 +260,7 @@ struct tgsi_exec_machine
    struct tgsi_sampler           **Samplers;
 
    unsigned                      ImmLimit;
-   const void *Consts[PIPE_MAX_CONSTANT];
+   const void *Consts[PIPE_MAX_CONSTANT_BUFFERS];
    const struct tgsi_token       *Tokens;   /**< Declarations, instructions */
    unsigned                      Processor; /**< TGSI_PROCESSOR_x */
 
index c18db2e5b7d9f5df5c21818751ecd983194a56f3..df0173928c7d35b7a39cab2ed6a51f62977722e4 100644 (file)
@@ -136,7 +136,7 @@ struct ureg_program
    unsigned temps_active[UREG_MAX_TEMP / 32];
    unsigned nr_temps;
 
-   struct const_decl const_decls[PIPE_MAX_CONSTANT];
+   struct const_decl const_decls[PIPE_MAX_CONSTANT_BUFFERS];
 
    unsigned property_gs_input_prim;
 
@@ -367,7 +367,7 @@ ureg_DECL_constant2D(struct ureg_program *ureg,
 {
    struct const_decl *decl = &ureg->const_decls[index2D];
 
-   assert(index2D < PIPE_MAX_CONSTANT);
+   assert(index2D < PIPE_MAX_CONSTANT_BUFFERS);
 
    if (decl->nr_constant_ranges < UREG_MAX_CONSTANT_RANGE) {
       uint i = decl->nr_constant_ranges++;
@@ -1209,7 +1209,7 @@ static void emit_decls( struct ureg_program *ureg )
                        ureg->sampler[i].Index, 1 );
    }
 
-   for (i = 0; i < PIPE_MAX_CONSTANT; i++) {
+   for (i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; i++) {
       struct const_decl *decl = &ureg->const_decls[i];
 
       if (decl->nr_constant_ranges) {
index a3a7825aa1882f9fd89eeb3b70de596d4bc77136..53133d288886b498280ddef471ed180272a512ef 100644 (file)
@@ -114,7 +114,7 @@ softpipe_destroy( struct pipe_context *pipe )
    for (i = 0; i < PIPE_SHADER_TYPES; i++) {
       uint j;
 
-      for (j = 0; j < PIPE_MAX_CONSTANT; j++) {
+      for (j = 0; j < PIPE_MAX_CONSTANT_BUFFERS; j++) {
          if (softpipe->constants[i][j]) {
             pipe_buffer_reference(&softpipe->constants[i][j], NULL);
          }
index f19b3cd5be289ba2e4f4b07b803b4ee74b88ee55..be4613b6228100d2a46e6c1153b8c2cbc303b161 100644 (file)
@@ -63,7 +63,7 @@ struct softpipe_context {
    /** Other rendering state */
    struct pipe_blend_color blend_color;
    struct pipe_clip_state clip;
-   struct pipe_buffer *constants[PIPE_SHADER_TYPES][PIPE_MAX_CONSTANT];
+   struct pipe_buffer *constants[PIPE_SHADER_TYPES][PIPE_MAX_CONSTANT_BUFFERS];
    struct pipe_framebuffer_state framebuffer;
    struct pipe_poly_stipple poly_stipple;
    struct pipe_scissor_state scissor;
@@ -92,7 +92,7 @@ struct softpipe_context {
    ubyte *mapped_vbuffer[PIPE_MAX_ATTRIBS];
 
    /** Mapped constant buffers */
-   void *mapped_constants[PIPE_SHADER_TYPES][PIPE_MAX_CONSTANT];
+   void *mapped_constants[PIPE_SHADER_TYPES][PIPE_MAX_CONSTANT_BUFFERS];
 
    /** Vertex format */
    struct vertex_info vertex_info;
index 06b97ab7c98f27d05d80b98238e324370682c62f..2b82427d5461cdfb31c5802c41fc07bd25127c01 100644 (file)
@@ -54,7 +54,7 @@ softpipe_map_constant_buffers(struct softpipe_context *sp)
    for (i = 0; i < PIPE_SHADER_TYPES; i++) {
       uint j;
 
-      for (j = 0; j < PIPE_MAX_CONSTANT; j++) {
+      for (j = 0; j < PIPE_MAX_CONSTANT_BUFFERS; j++) {
          if (sp->constants[i][j] && sp->constants[i][j]->size) {
             sp->mapped_constants[i][j] = ws->buffer_map(ws,
                                                         sp->constants[i][j],
@@ -63,7 +63,7 @@ softpipe_map_constant_buffers(struct softpipe_context *sp)
       }
    }
 
-   for (i = 0; i < PIPE_MAX_CONSTANT; i++) {
+   for (i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; i++) {
       if (sp->constants[PIPE_SHADER_VERTEX][i]) {
          draw_set_mapped_constant_buffer(sp->draw,
                                          PIPE_SHADER_VERTEX,
@@ -93,7 +93,7 @@ softpipe_unmap_constant_buffers(struct softpipe_context *sp)
     */
    draw_flush(sp->draw);
 
-   for (i = 0; i < PIPE_MAX_CONSTANT; i++) {
+   for (i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; i++) {
       draw_set_mapped_constant_buffer(sp->draw,
                                       PIPE_SHADER_VERTEX,
                                       i,
@@ -109,7 +109,7 @@ softpipe_unmap_constant_buffers(struct softpipe_context *sp)
    for (i = 0; i < PIPE_SHADER_TYPES; i++) {
       uint j;
 
-      for (j = 0; j < PIPE_MAX_CONSTANT; j++) {
+      for (j = 0; j < PIPE_MAX_CONSTANT_BUFFERS; j++) {
          if (sp->constants[i][j] && sp->constants[i][j]->size) {
             ws->buffer_unmap(ws, sp->constants[i][j]);
          }
index 9c497073c23fa4258daded10a8092c48a4b2bfa1..ad04dc2afc38d81d15ea1d4aef27c1a684188a4a 100644 (file)
@@ -109,7 +109,7 @@ shade_quads(struct quad_stage *qs,
    struct tgsi_exec_machine *machine = qss->machine;
    unsigned i, pass = 0;
 
-   for (i = 0; i < PIPE_MAX_CONSTANT; i++) {
+   for (i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; i++) {
       machine->Consts[i] = softpipe->mapped_constants[PIPE_SHADER_FRAGMENT][i];
    }
    machine->InterpCoefs = quads[0]->coef;
index 50ed51661aed2ca48f2eb5ed34ed6daf267d54bf..04bdcaacc2500c10179c58fa18b19fb8c0b3a9b0 100644 (file)
@@ -164,7 +164,7 @@ softpipe_set_constant_buffer(struct pipe_context *pipe,
    struct softpipe_context *softpipe = softpipe_context(pipe);
 
    assert(shader < PIPE_SHADER_TYPES);
-   assert(index < PIPE_MAX_CONSTANT);
+   assert(index < PIPE_MAX_CONSTANT_BUFFERS);
 
    draw_flush(softpipe->draw);
 
index fdd29ed449269af45e5432d885de3ca8b4d84904..b250ed9440455f1d5483388c2d3266939a3a7380 100644 (file)
@@ -58,7 +58,7 @@ extern "C" {
 #define PIPE_MAX_ATTRIBS          32
 #define PIPE_MAX_CLIP_PLANES       6
 #define PIPE_MAX_COLOR_BUFS        8
-#define PIPE_MAX_CONSTANT         32
+#define PIPE_MAX_CONSTANT_BUFFERS 32
 #define PIPE_MAX_SAMPLERS         16
 #define PIPE_MAX_VERTEX_SAMPLERS  16
 #define PIPE_MAX_SHADER_INPUTS    16