Replace gl_geom_result enum with gl_varying_slot.
authorPaul Berry <stereotype441@gmail.com>
Sat, 23 Feb 2013 15:49:04 +0000 (07:49 -0800)
committerPaul Berry <stereotype441@gmail.com>
Fri, 15 Mar 2013 16:25:36 +0000 (09:25 -0700)
This patch makes the following search-and-replace changes:

gl_geom_result -> gl_varying_slot
GEOM_RESULT_* -> VARYING_SLOT_*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
src/mesa/main/context.c
src/mesa/main/mtypes.h
src/mesa/program/program.c
src/mesa/state_tracker/st_glsl_to_tgsi.cpp
src/mesa/state_tracker/st_mesa_to_tgsi.c
src/mesa/state_tracker/st_program.c

index a0d34dc9c69b56c6477c7dea42bc65a9373904fc..40950ccc63a31252768cb24c9ab0c2d4c0c08457 100644 (file)
@@ -349,7 +349,6 @@ dummy_enum_func(void)
    gl_texture_index ti = TEXTURE_2D_ARRAY_INDEX;
    gl_vert_attrib va = VERT_ATTRIB_POS;
    gl_varying_slot vs = VARYING_SLOT_POS;
-   gl_geom_result gr = GEOM_RESULT_POS;
 
    (void) bi;
    (void) fi;
@@ -358,7 +357,6 @@ dummy_enum_func(void)
    (void) ti;
    (void) va;
    (void) vs;
-   (void) gr;
 }
 
 
index d760d2130470ef1fb78c6e7bb8cfa3844c5b039e..d88d3d355a914cf755738d19042436203bc921af 100644 (file)
@@ -285,34 +285,6 @@ typedef enum
 
 /*********************************************/
 
-/**
- * Indexes for geometry program result attributes
- */
-typedef enum
-{
-   GEOM_RESULT_POS  = VARYING_SLOT_POS,
-   GEOM_RESULT_COL0  = VARYING_SLOT_COL0,
-   GEOM_RESULT_COL1  = VARYING_SLOT_COL1,
-   GEOM_RESULT_SCOL0 = VARYING_SLOT_BFC0,
-   GEOM_RESULT_SCOL1 = VARYING_SLOT_BFC1,
-   GEOM_RESULT_FOGC = VARYING_SLOT_FOGC,
-   GEOM_RESULT_TEX0 = VARYING_SLOT_TEX0,
-   GEOM_RESULT_TEX1 = VARYING_SLOT_TEX1,
-   GEOM_RESULT_TEX2 = VARYING_SLOT_TEX2,
-   GEOM_RESULT_TEX3 = VARYING_SLOT_TEX3,
-   GEOM_RESULT_TEX4 = VARYING_SLOT_TEX4,
-   GEOM_RESULT_TEX5 = VARYING_SLOT_TEX5,
-   GEOM_RESULT_TEX6 = VARYING_SLOT_TEX6,
-   GEOM_RESULT_TEX7 = VARYING_SLOT_TEX7,
-   GEOM_RESULT_PSIZ = VARYING_SLOT_PSIZ,
-   GEOM_RESULT_CLPV = VARYING_SLOT_CLIP_VERTEX,
-   GEOM_RESULT_PRID = VARYING_SLOT_PRIMITIVE_ID,
-   GEOM_RESULT_LAYR = VARYING_SLOT_LAYER,
-   GEOM_RESULT_VAR0 = VARYING_SLOT_VAR0,
-   GEOM_RESULT_MAX  = VARYING_SLOT_MAX
-} gl_geom_result;
-
-
 /**
  * Indexes for fragment program input attributes.  Note that
  * _mesa_vert_result_to_frag_attrib() and frag_attrib_to_vert_result() make
index 5cc18d4099cedd55383ed0dcd69a7c76f62d88b6..bc7ab1ef8143ec6af209347a8ff5d798d463cf78 100644 (file)
@@ -951,7 +951,7 @@ _mesa_valid_register_index(const struct gl_context *ctx,
       case MESA_SHADER_FRAGMENT:
          return index < FRAG_RESULT_DATA0 + (GLint) ctx->Const.MaxDrawBuffers;
       case MESA_SHADER_GEOMETRY:
-         return index < GEOM_RESULT_VAR0 + (GLint) ctx->Const.MaxVarying;
+         return index < VARYING_SLOT_VAR0 + (GLint) ctx->Const.MaxVarying;
       default:
          return GL_FALSE;
       }
index ebb806864dd801cfb08574816a6004c43515cd5c..b4f94657ed1359cac8b6f99beaebc570a9b3398f 100644 (file)
@@ -4148,7 +4148,7 @@ dst_register(struct st_translate *t,
       else if (t->procType == TGSI_PROCESSOR_FRAGMENT)
          assert(index < FRAG_RESULT_MAX);
       else
-         assert(index < GEOM_RESULT_MAX);
+         assert(index < VARYING_SLOT_MAX);
 
       assert(t->outputMapping[index] < Elements(t->outputs));
 
index e494f45e8f35168dc4e39e53235f308d644e586b..a874e2610e9c2786bf80db916586bcb7391ab7c7 100644 (file)
@@ -179,7 +179,7 @@ dst_register( struct st_translate *t,
       else if (t->procType == TGSI_PROCESSOR_FRAGMENT)
          assert(index < FRAG_RESULT_MAX);
       else
-         assert(index < GEOM_RESULT_MAX);
+         assert(index < VARYING_SLOT_MAX);
 
       assert(t->outputMapping[index] < Elements(t->outputs));
 
index 8bc2a12f581fa04f6fd6503d996a96c1adabc421..6afad9b4155513aced413748f41fa16f2e0b7be2 100644 (file)
@@ -801,7 +801,7 @@ st_translate_geometry_program(struct st_context *st,
                               const struct st_gp_variant_key *key)
 {
    GLuint inputMapping[VARYING_SLOT_MAX];
-   GLuint outputMapping[GEOM_RESULT_MAX];
+   GLuint outputMapping[VARYING_SLOT_MAX];
    struct pipe_context *pipe = st->pipe;
    GLuint attr;
    GLbitfield64 inputsRead;
@@ -912,7 +912,7 @@ st_translate_geometry_program(struct st_context *st,
     * Determine number of outputs, the (default) output register
     * mapping and the semantic information for each output.
     */
-   for (attr = 0; attr < GEOM_RESULT_MAX; attr++) {
+   for (attr = 0; attr < VARYING_SLOT_MAX; attr++) {
       if (stgp->Base.Base.OutputsWritten & BITFIELD64_BIT(attr)) {
          GLuint slot;
 
@@ -921,45 +921,45 @@ st_translate_geometry_program(struct st_context *st,
          outputMapping[attr] = slot;
 
          switch (attr) {
-         case GEOM_RESULT_POS:
+         case VARYING_SLOT_POS:
             assert(slot == 0);
             gs_output_semantic_name[slot] = TGSI_SEMANTIC_POSITION;
             gs_output_semantic_index[slot] = 0;
             break;
-         case GEOM_RESULT_COL0:
+         case VARYING_SLOT_COL0:
             gs_output_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
             gs_output_semantic_index[slot] = 0;
             break;
-         case GEOM_RESULT_COL1:
+         case VARYING_SLOT_COL1:
             gs_output_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
             gs_output_semantic_index[slot] = 1;
             break;
-         case GEOM_RESULT_SCOL0:
+         case VARYING_SLOT_BFC0:
             gs_output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR;
             gs_output_semantic_index[slot] = 0;
             break;
-         case GEOM_RESULT_SCOL1:
+         case VARYING_SLOT_BFC1:
             gs_output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR;
             gs_output_semantic_index[slot] = 1;
             break;
-         case GEOM_RESULT_FOGC:
+         case VARYING_SLOT_FOGC:
             gs_output_semantic_name[slot] = TGSI_SEMANTIC_FOG;
             gs_output_semantic_index[slot] = 0;
             break;
-         case GEOM_RESULT_PSIZ:
+         case VARYING_SLOT_PSIZ:
             gs_output_semantic_name[slot] = TGSI_SEMANTIC_PSIZE;
             gs_output_semantic_index[slot] = 0;
             break;
-         case GEOM_RESULT_TEX0:
-         case GEOM_RESULT_TEX1:
-         case GEOM_RESULT_TEX2:
-         case GEOM_RESULT_TEX3:
-         case GEOM_RESULT_TEX4:
-         case GEOM_RESULT_TEX5:
-         case GEOM_RESULT_TEX6:
-         case GEOM_RESULT_TEX7:
+         case VARYING_SLOT_TEX0:
+         case VARYING_SLOT_TEX1:
+         case VARYING_SLOT_TEX2:
+         case VARYING_SLOT_TEX3:
+         case VARYING_SLOT_TEX4:
+         case VARYING_SLOT_TEX5:
+         case VARYING_SLOT_TEX6:
+         case VARYING_SLOT_TEX7:
             /* fall-through */
-         case GEOM_RESULT_VAR0:
+         case VARYING_SLOT_VAR0:
             /* fall-through */
          default:
             assert(slot < Elements(gs_output_semantic_name));
@@ -973,7 +973,7 @@ st_translate_geometry_program(struct st_context *st,
    assert(gs_output_semantic_name[0] == TGSI_SEMANTIC_POSITION);
 
    /* find max output slot referenced to compute gs_num_outputs */
-   for (attr = 0; attr < GEOM_RESULT_MAX; attr++) {
+   for (attr = 0; attr < VARYING_SLOT_MAX; attr++) {
       if (outputMapping[attr] != ~0 && outputMapping[attr] > maxSlot)
          maxSlot = outputMapping[attr];
    }