[Mesa-dev] [PATCH] compiler: Rename INTERP_QUALIFIER_* to INTERP_MODE_*.

Kenneth Graunke kenneth at whitecape.org
Thu Jul 14 17:39:56 UTC 2016


Likewise, rename the enum type to glsl_interp_mode.

Beyond the GLSL front-end, talking about "interpolation modes" seems
more natural than "interpolation qualifiers" - in the IR, we're removed
from how exactly the source language specifies how to interpolate an
input.  Also, SPIR-V calls these "decorations" rather than "qualifiers".

Generated by:
$ find . -regextype egrep -regex '.*\.(c|cpp|h)' -type f -exec sed -i \
  -e 's/INTERP_QUALIFIER_/INTERP_MODE_/g' \
  -e 's/glsl_interp_qualifier/glsl_interp_mode/g' {} \;

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/compiler/glsl/ast_to_hir.cpp                   | 24 ++++++++++----------
 src/compiler/glsl/builtin_variables.cpp            | 20 ++++++++---------
 src/compiler/glsl/ir.cpp                           | 10 ++++-----
 src/compiler/glsl/ir.h                             |  4 ++--
 src/compiler/glsl/ir_print_visitor.cpp             |  2 +-
 src/compiler/glsl/ir_reader.cpp                    |  6 ++---
 src/compiler/glsl/ir_set_program_inouts.cpp        |  2 +-
 src/compiler/glsl/link_varyings.cpp                |  6 ++---
 src/compiler/glsl/lower_packed_varyings.cpp        |  6 ++---
 src/compiler/nir/nir.c                             |  2 +-
 src/compiler/nir/nir.h                             |  2 +-
 src/compiler/nir/nir_lower_two_sided_color.c       |  2 +-
 src/compiler/nir/nir_print.c                       |  2 +-
 src/compiler/shader_enums.c                        | 12 +++++-----
 src/compiler/shader_enums.h                        | 16 ++++++-------
 src/compiler/spirv/spirv_to_nir.c                  |  4 ++--
 src/compiler/spirv/vtn_variables.c                 |  4 ++--
 src/gallium/auxiliary/nir/tgsi_to_nir.c            |  6 ++---
 src/gallium/drivers/freedreno/a3xx/fd3_program.c   |  2 +-
 src/gallium/drivers/freedreno/a4xx/fd4_program.c   |  2 +-
 .../drivers/freedreno/ir3/ir3_compiler_nir.c       |  6 ++---
 src/gallium/drivers/freedreno/ir3/ir3_shader.h     |  2 +-
 src/intel/vulkan/anv_meta_blit.c                   |  2 +-
 src/intel/vulkan/anv_meta_blit2d.c                 |  8 +++----
 src/intel/vulkan/anv_meta_clear.c                  |  2 +-
 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp       |  2 +-
 src/mesa/drivers/dri/i965/brw_blorp_clear.cpp      |  2 +-
 src/mesa/drivers/dri/i965/brw_clip_util.c          |  6 ++---
 src/mesa/drivers/dri/i965/brw_context.h            |  4 ++--
 src/mesa/drivers/dri/i965/brw_fs.cpp               | 26 +++++++++++-----------
 src/mesa/drivers/dri/i965/brw_fs.h                 |  2 +-
 src/mesa/drivers/dri/i965/brw_fs_nir.cpp           | 10 ++++-----
 src/mesa/drivers/dri/i965/brw_interpolation_map.c  | 20 ++++++++---------
 src/mesa/drivers/dri/i965/brw_sf_emit.c            | 14 ++++++------
 src/mesa/main/mtypes.h                             |  6 ++---
 src/mesa/state_tracker/st_nir_lower_builtin.c      |  6 ++---
 src/mesa/state_tracker/st_program.c                | 10 ++++-----
 37 files changed, 131 insertions(+), 131 deletions(-)

diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 8ddc084..1b88290 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -2826,7 +2826,7 @@ apply_explicit_binding(struct _mesa_glsl_parse_state *state,
 static void
 validate_interpolation_qualifier(struct _mesa_glsl_parse_state *state,
                                  YYLTYPE *loc,
-                                 const glsl_interp_qualifier interpolation,
+                                 const glsl_interp_mode interpolation,
                                  const struct ast_type_qualifier *qual,
                                  const struct glsl_type *var_type,
                                  ir_variable_mode mode)
@@ -2855,7 +2855,7 @@ validate_interpolation_qualifier(struct _mesa_glsl_parse_state *state,
     *    fragment shader."
     */
    if (state->is_version(130, 300)
-       && interpolation != INTERP_QUALIFIER_NONE) {
+       && interpolation != INTERP_MODE_NONE) {
       const char *i = interpolation_string(interpolation);
       if (mode != ir_var_shader_in && mode != ir_var_shader_out)
          _mesa_glsl_error(loc, state,
@@ -2893,7 +2893,7 @@ validate_interpolation_qualifier(struct _mesa_glsl_parse_state *state,
     * These deprecated storage qualifiers do not exist in GLSL ES 3.00.
     */
    if (state->is_version(130, 0)
-       && interpolation != INTERP_QUALIFIER_NONE
+       && interpolation != INTERP_MODE_NONE
        && qual->flags.q.varying) {
 
       const char *i = interpolation_string(interpolation);
@@ -2939,7 +2939,7 @@ validate_interpolation_qualifier(struct _mesa_glsl_parse_state *state,
     */
    if (state->is_version(130, 300)
        && var_type->contains_integer()
-       && interpolation != INTERP_QUALIFIER_FLAT
+       && interpolation != INTERP_MODE_FLAT
        && ((state->stage == MESA_SHADER_FRAGMENT && mode == ir_var_shader_in)
            || (state->stage == MESA_SHADER_VERTEX && mode == ir_var_shader_out
                && state->es_shader))) {
@@ -2969,7 +2969,7 @@ validate_interpolation_qualifier(struct _mesa_glsl_parse_state *state,
     */
    if (state->has_double()
        && var_type->contains_double()
-       && interpolation != INTERP_QUALIFIER_FLAT
+       && interpolation != INTERP_MODE_FLAT
        && state->stage == MESA_SHADER_FRAGMENT
        && mode == ir_var_shader_in) {
       _mesa_glsl_error(loc, state, "if a fragment input is (or contains) "
@@ -2977,20 +2977,20 @@ validate_interpolation_qualifier(struct _mesa_glsl_parse_state *state,
    }
 }
 
-static glsl_interp_qualifier
+static glsl_interp_mode
 interpret_interpolation_qualifier(const struct ast_type_qualifier *qual,
                                   const struct glsl_type *var_type,
                                   ir_variable_mode mode,
                                   struct _mesa_glsl_parse_state *state,
                                   YYLTYPE *loc)
 {
-   glsl_interp_qualifier interpolation;
+   glsl_interp_mode interpolation;
    if (qual->flags.q.flat)
-      interpolation = INTERP_QUALIFIER_FLAT;
+      interpolation = INTERP_MODE_FLAT;
    else if (qual->flags.q.noperspective)
-      interpolation = INTERP_QUALIFIER_NOPERSPECTIVE;
+      interpolation = INTERP_MODE_NOPERSPECTIVE;
    else if (qual->flags.q.smooth)
-      interpolation = INTERP_QUALIFIER_SMOOTH;
+      interpolation = INTERP_MODE_SMOOTH;
    else if (state->es_shader &&
             ((mode == ir_var_shader_in &&
               state->stage != MESA_SHADER_VERTEX) ||
@@ -3001,9 +3001,9 @@ interpret_interpolation_qualifier(const struct ast_type_qualifier *qual,
        *    "When no interpolation qualifier is present, smooth interpolation
        *    is used."
        */
-      interpolation = INTERP_QUALIFIER_SMOOTH;
+      interpolation = INTERP_MODE_SMOOTH;
    else
-      interpolation = INTERP_QUALIFIER_NONE;
+      interpolation = INTERP_MODE_NONE;
 
    validate_interpolation_qualifier(state, loc,
                                     interpolation,
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
index a311047..f63dc3a 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -330,7 +330,7 @@ per_vertex_accumulator::add_field(int slot, const glsl_type *type,
    this->fields[this->num_fields].matrix_layout = GLSL_MATRIX_LAYOUT_INHERITED;
    this->fields[this->num_fields].location = slot;
    this->fields[this->num_fields].offset = -1;
-   this->fields[this->num_fields].interpolation = INTERP_QUALIFIER_NONE;
+   this->fields[this->num_fields].interpolation = INTERP_MODE_NONE;
    this->fields[this->num_fields].centroid = 0;
    this->fields[this->num_fields].sample = 0;
    this->fields[this->num_fields].patch = 0;
@@ -1004,11 +1004,11 @@ builtin_variable_generator::generate_vs_special_vars()
    }
    if (state->AMD_vertex_shader_layer_enable) {
       var = add_output(VARYING_SLOT_LAYER, int_t, "gl_Layer");
-      var->data.interpolation = INTERP_QUALIFIER_FLAT;
+      var->data.interpolation = INTERP_MODE_FLAT;
    }
    if (state->AMD_vertex_shader_viewport_index_enable) {
       var = add_output(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
-      var->data.interpolation = INTERP_QUALIFIER_FLAT;
+      var->data.interpolation = INTERP_MODE_FLAT;
    }
    if (compatibility) {
       add_input(VERT_ATTRIB_POS, vec4_t, "gl_Vertex");
@@ -1075,10 +1075,10 @@ builtin_variable_generator::generate_gs_special_vars()
    ir_variable *var;
 
    var = add_output(VARYING_SLOT_LAYER, int_t, "gl_Layer");
-   var->data.interpolation = INTERP_QUALIFIER_FLAT;
+   var->data.interpolation = INTERP_MODE_FLAT;
    if (state->is_version(410, 0) || state->ARB_viewport_array_enable) {
       var = add_output(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
-      var->data.interpolation = INTERP_QUALIFIER_FLAT;
+      var->data.interpolation = INTERP_MODE_FLAT;
    }
    if (state->is_version(400, 0) || state->ARB_gpu_shader5_enable)
       add_system_value(SYSTEM_VALUE_INVOCATION_ID, int_t, "gl_InvocationID");
@@ -1094,9 +1094,9 @@ builtin_variable_generator::generate_gs_special_vars()
     * gl_PrimitiveIDIn as an {ARB,EXT}_geometry_shader4-only variable.
     */
    var = add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveIDIn");
-   var->data.interpolation = INTERP_QUALIFIER_FLAT;
+   var->data.interpolation = INTERP_MODE_FLAT;
    var = add_output(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID");
-   var->data.interpolation = INTERP_QUALIFIER_FLAT;
+   var->data.interpolation = INTERP_MODE_FLAT;
 }
 
 
@@ -1123,7 +1123,7 @@ builtin_variable_generator::generate_fs_special_vars()
 
    if (state->has_geometry_shader()) {
       var = add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID");
-      var->data.interpolation = INTERP_QUALIFIER_FLAT;
+      var->data.interpolation = INTERP_MODE_FLAT;
    }
 
    /* gl_FragColor and gl_FragData were deprecated starting in desktop GLSL
@@ -1192,9 +1192,9 @@ builtin_variable_generator::generate_fs_special_vars()
 
    if (state->is_version(430, 0) || state->ARB_fragment_layer_viewport_enable) {
       var = add_input(VARYING_SLOT_LAYER, int_t, "gl_Layer");
-      var->data.interpolation = INTERP_QUALIFIER_FLAT;
+      var->data.interpolation = INTERP_MODE_FLAT;
       var = add_input(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
-      var->data.interpolation = INTERP_QUALIFIER_FLAT;
+      var->data.interpolation = INTERP_MODE_FLAT;
    }
 
    if (state->is_version(450, 310) || state->ARB_ES3_1_compatibility_enable)
diff --git a/src/compiler/glsl/ir.cpp b/src/compiler/glsl/ir.cpp
index 7961f00..b049fda 100644
--- a/src/compiler/glsl/ir.cpp
+++ b/src/compiler/glsl/ir.cpp
@@ -1676,7 +1676,7 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
    this->data.invariant = false;
    this->data.how_declared = ir_var_declared_normally;
    this->data.mode = mode;
-   this->data.interpolation = INTERP_QUALIFIER_NONE;
+   this->data.interpolation = INTERP_MODE_NONE;
    this->data.max_array_access = -1;
    this->data.offset = 0;
    this->data.precision = GLSL_PRECISION_NONE;
@@ -1703,10 +1703,10 @@ const char *
 interpolation_string(unsigned interpolation)
 {
    switch (interpolation) {
-   case INTERP_QUALIFIER_NONE:          return "no";
-   case INTERP_QUALIFIER_SMOOTH:        return "smooth";
-   case INTERP_QUALIFIER_FLAT:          return "flat";
-   case INTERP_QUALIFIER_NOPERSPECTIVE: return "noperspective";
+   case INTERP_MODE_NONE:          return "no";
+   case INTERP_MODE_SMOOTH:        return "smooth";
+   case INTERP_MODE_FLAT:          return "flat";
+   case INTERP_MODE_NOPERSPECTIVE: return "noperspective";
    }
 
    assert(!"Should not get here.");
diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h
index 1325e35..5d93cf1 100644
--- a/src/compiler/glsl/ir.h
+++ b/src/compiler/glsl/ir.h
@@ -592,7 +592,7 @@ public:
 
    inline bool is_interpolation_flat() const
    {
-      return this->data.interpolation == INTERP_QUALIFIER_FLAT ||
+      return this->data.interpolation == INTERP_MODE_FLAT ||
              this->type->contains_integer() ||
              this->type->contains_double();
    }
@@ -686,7 +686,7 @@ public:
       /**
        * Interpolation mode for shader inputs / outputs
        *
-       * \sa glsl_interp_qualifier
+       * \sa glsl_interp_mode
        */
       unsigned interpolation:2;
 
diff --git a/src/compiler/glsl/ir_print_visitor.cpp b/src/compiler/glsl/ir_print_visitor.cpp
index e06acce..0dd1c35 100644
--- a/src/compiler/glsl/ir_print_visitor.cpp
+++ b/src/compiler/glsl/ir_print_visitor.cpp
@@ -181,7 +181,7 @@ void ir_print_visitor::visit(ir_variable *ir)
    STATIC_ASSERT(ARRAY_SIZE(mode) == ir_var_mode_count);
    const char *const stream [] = {"", "stream1 ", "stream2 ", "stream3 "};
    const char *const interp[] = { "", "smooth", "flat", "noperspective" };
-   STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_QUALIFIER_COUNT);
+   STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_MODE_COUNT);
 
    fprintf(f, "(%s%s%s%s%s%s%s%s%s) ",
            loc, cent, samp, patc, inv, prec, mode[ir->data.mode],
diff --git a/src/compiler/glsl/ir_reader.cpp b/src/compiler/glsl/ir_reader.cpp
index 15315aa..7deb125 100644
--- a/src/compiler/glsl/ir_reader.cpp
+++ b/src/compiler/glsl/ir_reader.cpp
@@ -448,11 +448,11 @@ ir_reader::read_declaration(s_expression *expr)
       } else if (strcmp(qualifier->value(), "stream3") == 0) {
 	 var->data.stream = 3;
       } else if (strcmp(qualifier->value(), "smooth") == 0) {
-	 var->data.interpolation = INTERP_QUALIFIER_SMOOTH;
+	 var->data.interpolation = INTERP_MODE_SMOOTH;
       } else if (strcmp(qualifier->value(), "flat") == 0) {
-	 var->data.interpolation = INTERP_QUALIFIER_FLAT;
+	 var->data.interpolation = INTERP_MODE_FLAT;
       } else if (strcmp(qualifier->value(), "noperspective") == 0) {
-	 var->data.interpolation = INTERP_QUALIFIER_NOPERSPECTIVE;
+	 var->data.interpolation = INTERP_MODE_NOPERSPECTIVE;
       } else {
 	 ir_read_error(expr, "unknown qualifier: %s", qualifier->value());
 	 return NULL;
diff --git a/src/compiler/glsl/ir_set_program_inouts.cpp b/src/compiler/glsl/ir_set_program_inouts.cpp
index 1f9971d..7c61994 100644
--- a/src/compiler/glsl/ir_set_program_inouts.cpp
+++ b/src/compiler/glsl/ir_set_program_inouts.cpp
@@ -125,7 +125,7 @@ mark(struct gl_program *prog, ir_variable *var, int offset, int len,
          if (stage == MESA_SHADER_FRAGMENT) {
             gl_fragment_program *fprog = (gl_fragment_program *) prog;
             fprog->InterpQualifier[idx] =
-               (glsl_interp_qualifier) var->data.interpolation;
+               (glsl_interp_mode) var->data.interpolation;
             if (var->data.centroid)
                fprog->IsCentroid |= bitfield;
             if (var->data.sample)
diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index 76d0be1..29362c4 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -1388,13 +1388,13 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var)
       if (producer_var) {
          producer_var->data.centroid = false;
          producer_var->data.sample = false;
-         producer_var->data.interpolation = INTERP_QUALIFIER_FLAT;
+         producer_var->data.interpolation = INTERP_MODE_FLAT;
       }
 
       if (consumer_var) {
          consumer_var->data.centroid = false;
          consumer_var->data.sample = false;
-         consumer_var->data.interpolation = INTERP_QUALIFIER_FLAT;
+         consumer_var->data.interpolation = INTERP_MODE_FLAT;
       }
    }
 
@@ -1612,7 +1612,7 @@ varying_matches::compute_packing_class(const ir_variable *var)
                             (var->data.patch << 2);
    packing_class *= 4;
    packing_class += var->is_interpolation_flat()
-      ? unsigned(INTERP_QUALIFIER_FLAT) : var->data.interpolation;
+      ? unsigned(INTERP_MODE_FLAT) : var->data.interpolation;
    return packing_class;
 }
 
diff --git a/src/compiler/glsl/lower_packed_varyings.cpp b/src/compiler/glsl/lower_packed_varyings.cpp
index 2b34739..4eeb4b4 100644
--- a/src/compiler/glsl/lower_packed_varyings.cpp
+++ b/src/compiler/glsl/lower_packed_varyings.cpp
@@ -276,8 +276,8 @@ lower_packed_varyings_visitor::run(struct gl_linked_shader *shader)
        * together when their interpolation mode is "flat".  Treat integers as
        * being flat when the interpolation mode is none.
        */
-      assert(var->data.interpolation == INTERP_QUALIFIER_FLAT ||
-             var->data.interpolation == INTERP_QUALIFIER_NONE ||
+      assert(var->data.interpolation == INTERP_MODE_FLAT ||
+             var->data.interpolation == INTERP_MODE_NONE ||
              !var->type->contains_integer());
 
       /* Clone the variable for program resource list before
@@ -628,7 +628,7 @@ lower_packed_varyings_visitor::get_packed_varying_deref(
       packed_var->data.sample = unpacked_var->data.sample;
       packed_var->data.patch = unpacked_var->data.patch;
       packed_var->data.interpolation = packed_type == glsl_type::ivec4_type
-         ? unsigned(INTERP_QUALIFIER_FLAT) : unpacked_var->data.interpolation;
+         ? unsigned(INTERP_MODE_FLAT) : unpacked_var->data.interpolation;
       packed_var->data.location = location;
       packed_var->data.precision = unpacked_var->data.precision;
       packed_var->data.always_active_io = unpacked_var->data.always_active_io;
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 3c8b4e0..b5d4614 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -161,7 +161,7 @@ nir_variable_create(nir_shader *shader, nir_variable_mode mode,
 
    if ((mode == nir_var_shader_in && shader->stage != MESA_SHADER_VERTEX) ||
        (mode == nir_var_shader_out && shader->stage != MESA_SHADER_FRAGMENT))
-      var->data.interpolation = INTERP_QUALIFIER_SMOOTH;
+      var->data.interpolation = INTERP_MODE_SMOOTH;
 
    if (mode == nir_var_shader_in || mode == nir_var_uniform)
       var->data.read_only = true;
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index a7921ee..c5d3b6b 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -179,7 +179,7 @@ typedef struct nir_variable {
       /**
        * Interpolation mode for shader inputs / outputs
        *
-       * \sa glsl_interp_qualifier
+       * \sa glsl_interp_mode
        */
       unsigned interpolation:2;
 
diff --git a/src/compiler/nir/nir_lower_two_sided_color.c b/src/compiler/nir/nir_lower_two_sided_color.c
index 5d8779e..3e66669 100644
--- a/src/compiler/nir/nir_lower_two_sided_color.c
+++ b/src/compiler/nir/nir_lower_two_sided_color.c
@@ -114,7 +114,7 @@ setup_inputs(lower_2side_state *state)
    /* if we don't already have one, insert a FACE input: */
    if (!state->face) {
       state->face = create_input(state->shader, ++maxloc, VARYING_SLOT_FACE);
-      state->face->data.interpolation = INTERP_QUALIFIER_FLAT;
+      state->face->data.interpolation = INTERP_MODE_FLAT;
    }
 
    /* add required back-face color inputs: */
diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c
index bca8a35..a3380e6 100644
--- a/src/compiler/nir/nir_print.c
+++ b/src/compiler/nir/nir_print.c
@@ -374,7 +374,7 @@ print_var_decl(nir_variable *var, print_state *state)
    const char *const inv = (var->data.invariant) ? "invariant " : "";
    fprintf(fp, "%s%s%s%s%s %s ",
            cent, samp, patch, inv, get_variable_mode_str(var->data.mode),
-           glsl_interp_qualifier_name(var->data.interpolation));
+           glsl_interp_mode_name(var->data.interpolation));
 
    const char *const coher = (var->data.image.coherent) ? "coherent " : "";
    const char *const volat = (var->data.image._volatile) ? "volatile " : "";
diff --git a/src/compiler/shader_enums.c b/src/compiler/shader_enums.c
index ff2f564..00261d1 100644
--- a/src/compiler/shader_enums.c
+++ b/src/compiler/shader_enums.c
@@ -226,15 +226,15 @@ gl_system_value_name(gl_system_value sysval)
 }
 
 const char *
-glsl_interp_qualifier_name(enum glsl_interp_qualifier qual)
+glsl_interp_mode_name(enum glsl_interp_mode qual)
 {
    static const char *names[] = {
-      ENUM(INTERP_QUALIFIER_NONE),
-      ENUM(INTERP_QUALIFIER_SMOOTH),
-      ENUM(INTERP_QUALIFIER_FLAT),
-      ENUM(INTERP_QUALIFIER_NOPERSPECTIVE),
+      ENUM(INTERP_MODE_NONE),
+      ENUM(INTERP_MODE_SMOOTH),
+      ENUM(INTERP_MODE_FLAT),
+      ENUM(INTERP_MODE_NOPERSPECTIVE),
    };
-   STATIC_ASSERT(ARRAY_SIZE(names) == INTERP_QUALIFIER_COUNT);
+   STATIC_ASSERT(ARRAY_SIZE(names) == INTERP_MODE_COUNT);
    return NAME(qual);
 }
 
diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h
index df3124e..a69905c 100644
--- a/src/compiler/shader_enums.h
+++ b/src/compiler/shader_enums.h
@@ -485,19 +485,19 @@ const char *gl_system_value_name(gl_system_value sysval);
  * The possible interpolation qualifiers that can be applied to a fragment
  * shader input in GLSL.
  *
- * Note: INTERP_QUALIFIER_NONE must be 0 so that memsetting the
+ * Note: INTERP_MODE_NONE must be 0 so that memsetting the
  * gl_fragment_program data structure to 0 causes the default behavior.
  */
-enum glsl_interp_qualifier
+enum glsl_interp_mode
 {
-   INTERP_QUALIFIER_NONE = 0,
-   INTERP_QUALIFIER_SMOOTH,
-   INTERP_QUALIFIER_FLAT,
-   INTERP_QUALIFIER_NOPERSPECTIVE,
-   INTERP_QUALIFIER_COUNT /**< Number of interpolation qualifiers */
+   INTERP_MODE_NONE = 0,
+   INTERP_MODE_SMOOTH,
+   INTERP_MODE_FLAT,
+   INTERP_MODE_NOPERSPECTIVE,
+   INTERP_MODE_COUNT /**< Number of interpolation qualifiers */
 };
 
-const char *glsl_interp_qualifier_name(enum glsl_interp_qualifier qual);
+const char *glsl_interp_mode_name(enum glsl_interp_mode qual);
 
 /**
  * Fragment program results
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 85f53a0..1efda9b 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -478,10 +478,10 @@ struct_member_decoration_cb(struct vtn_builder *b,
    case SpvDecorationUniform:
       break; /* FIXME: Do nothing with this for now. */
    case SpvDecorationNoPerspective:
-      ctx->fields[member].interpolation = INTERP_QUALIFIER_NOPERSPECTIVE;
+      ctx->fields[member].interpolation = INTERP_MODE_NOPERSPECTIVE;
       break;
    case SpvDecorationFlat:
-      ctx->fields[member].interpolation = INTERP_QUALIFIER_FLAT;
+      ctx->fields[member].interpolation = INTERP_MODE_FLAT;
       break;
    case SpvDecorationCentroid:
       ctx->fields[member].centroid = true;
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 8b112b0..84664ad 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -968,10 +968,10 @@ var_decoration_cb(struct vtn_builder *b, struct vtn_value *val, int member,
    case SpvDecorationRelaxedPrecision:
       break; /* FIXME: Do nothing with this for now. */
    case SpvDecorationNoPerspective:
-      nir_var->data.interpolation = INTERP_QUALIFIER_NOPERSPECTIVE;
+      nir_var->data.interpolation = INTERP_MODE_NOPERSPECTIVE;
       break;
    case SpvDecorationFlat:
-      nir_var->data.interpolation = INTERP_QUALIFIER_FLAT;
+      nir_var->data.interpolation = INTERP_MODE_FLAT;
       break;
    case SpvDecorationCentroid:
       nir_var->data.centroid = true;
diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c
index e2b305e..e1d7c68 100644
--- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
+++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
@@ -353,13 +353,13 @@ ttn_emit_declaration(struct ttn_compile *c)
              */
             switch (decl->Interp.Interpolate) {
             case TGSI_INTERPOLATE_CONSTANT:
-               var->data.interpolation = INTERP_QUALIFIER_FLAT;
+               var->data.interpolation = INTERP_MODE_FLAT;
                break;
             case TGSI_INTERPOLATE_LINEAR:
-               var->data.interpolation = INTERP_QUALIFIER_NOPERSPECTIVE;
+               var->data.interpolation = INTERP_MODE_NOPERSPECTIVE;
                break;
             case TGSI_INTERPOLATE_PERSPECTIVE:
-               var->data.interpolation = INTERP_QUALIFIER_SMOOTH;
+               var->data.interpolation = INTERP_MODE_SMOOTH;
                break;
             }
 
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_program.c b/src/gallium/drivers/freedreno/a3xx/fd3_program.c
index 8152f8f..485a4da 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_program.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_program.c
@@ -392,7 +392,7 @@ fd3_program_emit(struct fd_ringbuffer *ring, struct fd3_emit *emit,
 			 */
 			uint32_t inloc = fp->inputs[j].inloc - 8;
 
-			if ((fp->inputs[j].interpolate == INTERP_QUALIFIER_FLAT) ||
+			if ((fp->inputs[j].interpolate == INTERP_MODE_FLAT) ||
 					(fp->inputs[j].rasterflat && emit->rasterflat)) {
 				uint32_t loc = inloc;
 
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_program.c b/src/gallium/drivers/freedreno/a4xx/fd4_program.c
index 4590c0e..0e8efc2 100644
--- a/src/gallium/drivers/freedreno/a4xx/fd4_program.c
+++ b/src/gallium/drivers/freedreno/a4xx/fd4_program.c
@@ -520,7 +520,7 @@ fd4_program_emit(struct fd_ringbuffer *ring, struct fd4_emit *emit,
 			 */
 			uint32_t inloc = s[FS].v->inputs[j].inloc - 8;
 
-			if ((s[FS].v->inputs[j].interpolate == INTERP_QUALIFIER_FLAT) ||
+			if ((s[FS].v->inputs[j].interpolate == INTERP_MODE_FLAT) ||
 					(s[FS].v->inputs[j].rasterflat && emit->rasterflat)) {
 				uint32_t loc = inloc;
 
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
index 5c7ad84..14d5e50 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
@@ -1146,7 +1146,7 @@ static void add_sysval_input(struct ir3_compile *ctx, gl_system_value slot,
 	so->inputs[n].slot = slot;
 	so->inputs[n].compmask = 1;
 	so->inputs[n].regid = r;
-	so->inputs[n].interpolate = INTERP_QUALIFIER_FLAT;
+	so->inputs[n].interpolate = INTERP_MODE_FLAT;
 	so->total_in++;
 
 	ctx->ir->ninputs = MAX2(ctx->ir->ninputs, r + 1);
@@ -2055,7 +2055,7 @@ setup_input(struct ir3_compile *ctx, nir_variable *in)
 				 * we need to do flat vs smooth shading depending on
 				 * rast state:
 				 */
-				if (in->data.interpolation == INTERP_QUALIFIER_NONE) {
+				if (in->data.interpolation == INTERP_MODE_NONE) {
 					switch (slot) {
 					case VARYING_SLOT_COL0:
 					case VARYING_SLOT_COL1:
@@ -2069,7 +2069,7 @@ setup_input(struct ir3_compile *ctx, nir_variable *in)
 				}
 
 				if (ctx->flat_bypass) {
-					if ((so->inputs[n].interpolate == INTERP_QUALIFIER_FLAT) ||
+					if ((so->inputs[n].interpolate == INTERP_MODE_FLAT) ||
 							(so->inputs[n].rasterflat && ctx->so->key.rasterflat))
 						use_ldlv = true;
 				}
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_shader.h b/src/gallium/drivers/freedreno/ir3/ir3_shader.h
index c17a76b..b773609 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_shader.h
+++ b/src/gallium/drivers/freedreno/ir3/ir3_shader.h
@@ -197,7 +197,7 @@ struct ir3_shader_variant {
 		/* fragment shader specific: */
 		bool    bary       : 1;   /* fetched varying (vs one loaded into reg) */
 		bool    rasterflat : 1;   /* special handling for emit->rasterflat */
-		enum glsl_interp_qualifier interpolate;
+		enum glsl_interp_mode interpolate;
 	} inputs[16 + 2];  /* +POSITION +FACE */
 
 	/* sum of input components (scalar).  For frag shaders, it only counts
diff --git a/src/intel/vulkan/anv_meta_blit.c b/src/intel/vulkan/anv_meta_blit.c
index dc098ef..e8b244b 100644
--- a/src/intel/vulkan/anv_meta_blit.c
+++ b/src/intel/vulkan/anv_meta_blit.c
@@ -54,7 +54,7 @@ build_nir_vertex_shader(void)
    nir_variable *tex_pos_out = nir_variable_create(b.shader, nir_var_shader_out,
                                                    vec4, "v_tex_pos");
    tex_pos_out->data.location = VARYING_SLOT_VAR0;
-   tex_pos_out->data.interpolation = INTERP_QUALIFIER_SMOOTH;
+   tex_pos_out->data.interpolation = INTERP_MODE_SMOOTH;
    nir_copy_var(&b, tex_pos_out, tex_pos_in);
 
    return b.shader;
diff --git a/src/intel/vulkan/anv_meta_blit2d.c b/src/intel/vulkan/anv_meta_blit2d.c
index d37d69d..5e48047 100644
--- a/src/intel/vulkan/anv_meta_blit2d.c
+++ b/src/intel/vulkan/anv_meta_blit2d.c
@@ -698,7 +698,7 @@ build_nir_vertex_shader(void)
    nir_variable *tex_pos_out = nir_variable_create(b.shader, nir_var_shader_out,
                                                    vec4, "v_tex_pos");
    tex_pos_out->data.location = VARYING_SLOT_VAR0;
-   tex_pos_out->data.interpolation = INTERP_QUALIFIER_SMOOTH;
+   tex_pos_out->data.interpolation = INTERP_MODE_SMOOTH;
    nir_copy_var(&b, tex_pos_out, tex_pos_in);
 
    nir_variable *other_in = nir_variable_create(b.shader, nir_var_shader_in,
@@ -707,7 +707,7 @@ build_nir_vertex_shader(void)
    nir_variable *other_out = nir_variable_create(b.shader, nir_var_shader_out,
                                                    vec4, "v_other");
    other_out->data.location = VARYING_SLOT_VAR1;
-   other_out->data.interpolation = INTERP_QUALIFIER_FLAT;
+   other_out->data.interpolation = INTERP_MODE_FLAT;
    nir_copy_var(&b, other_out, other_in);
 
    return b.shader;
@@ -965,7 +965,7 @@ build_nir_w_tiled_fragment_shader(struct anv_device *device,
    nir_variable *tex_off_in = nir_variable_create(b.shader, nir_var_shader_in,
                                                   ivec3, "v_tex_off");
    tex_off_in->data.location = VARYING_SLOT_VAR0;
-   tex_off_in->data.interpolation = INTERP_QUALIFIER_FLAT;
+   tex_off_in->data.interpolation = INTERP_MODE_FLAT;
 
    /* In location 1 we have a uvec4 that gives us the bounds of the
     * destination.  We need to discard if we get outside this boundary.
@@ -973,7 +973,7 @@ build_nir_w_tiled_fragment_shader(struct anv_device *device,
    nir_variable *bounds_in = nir_variable_create(b.shader, nir_var_shader_in,
                                                  uvec4, "v_bounds");
    bounds_in->data.location = VARYING_SLOT_VAR1;
-   bounds_in->data.interpolation = INTERP_QUALIFIER_FLAT;
+   bounds_in->data.interpolation = INTERP_MODE_FLAT;
 
    nir_variable *color_out = nir_variable_create(b.shader, nir_var_shader_out,
                                                  vec4, "f_color");
diff --git a/src/intel/vulkan/anv_meta_clear.c b/src/intel/vulkan/anv_meta_clear.c
index 7ec0608..e399498 100644
--- a/src/intel/vulkan/anv_meta_clear.c
+++ b/src/intel/vulkan/anv_meta_clear.c
@@ -94,7 +94,7 @@ build_color_shaders(struct nir_shader **out_vs,
       nir_variable_create(vs_b.shader, nir_var_shader_out, color_type,
                           "v_color");
    vs_out_color->data.location = VARYING_SLOT_VAR0;
-   vs_out_color->data.interpolation = INTERP_QUALIFIER_FLAT;
+   vs_out_color->data.interpolation = INTERP_MODE_FLAT;
 
    nir_variable *fs_in_color =
       nir_variable_create(fs_b.shader, nir_var_shader_in, color_type,
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 76e771f..a54680e 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -353,7 +353,7 @@ brw_blorp_blit_vars_init(nir_builder *b, struct brw_blorp_blit_vars *v,
 #define LOAD_INPUT(name, type)\
    v->v_##name = nir_variable_create(b->shader, nir_var_shader_in, \
                                      type, #name); \
-   v->v_##name->data.interpolation = INTERP_QUALIFIER_FLAT; \
+   v->v_##name->data.interpolation = INTERP_MODE_FLAT; \
    v->v_##name->data.location = VARYING_SLOT_VAR0 + \
       offsetof(struct brw_blorp_wm_inputs, name) / (4 * sizeof(float));
 
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
index a38ea0c..1bc0dbb 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
@@ -70,7 +70,7 @@ brw_blorp_params_get_clear_kernel(struct brw_context *brw,
    nir_variable *v_color = nir_variable_create(b.shader, nir_var_shader_in,
                                                glsl_vec4_type(), "v_color");
    v_color->data.location = VARYING_SLOT_VAR0;
-   v_color->data.interpolation = INTERP_QUALIFIER_FLAT;
+   v_color->data.interpolation = INTERP_MODE_FLAT;
 
    nir_variable *frag_color = nir_variable_create(b.shader, nir_var_shader_out,
                                                   glsl_vec4_type(),
diff --git a/src/mesa/drivers/dri/i965/brw_clip_util.c b/src/mesa/drivers/dri/i965/brw_clip_util.c
index 3e6664e..f5d0a5a 100644
--- a/src/mesa/drivers/dri/i965/brw_clip_util.c
+++ b/src/mesa/drivers/dri/i965/brw_clip_util.c
@@ -274,10 +274,10 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c,
 	  */
          GLuint interp = c->key.interpolation_mode.mode[slot];
 
-         if (interp != INTERP_QUALIFIER_FLAT) {
+         if (interp != INTERP_MODE_FLAT) {
             struct brw_reg tmp = get_tmp(c);
             struct brw_reg t =
-               interp == INTERP_QUALIFIER_NOPERSPECTIVE ? t_nopersp : t0;
+               interp == INTERP_MODE_NOPERSPECTIVE ? t_nopersp : t0;
 
             brw_MUL(p,
                   vec4(brw_null_reg()),
@@ -406,7 +406,7 @@ void brw_clip_copy_flatshaded_attributes( struct brw_clip_compile *c,
    struct brw_codegen *p = &c->func;
 
    for (int i = 0; i < c->vue_map.num_slots; i++) {
-      if (c->key.interpolation_mode.mode[i] == INTERP_QUALIFIER_FLAT) {
+      if (c->key.interpolation_mode.mode[i] == INTERP_MODE_FLAT) {
          brw_MOV(p,
                  byte_offset(c->reg.vertex[to], brw_vue_slot_to_offset(i)),
                  byte_offset(c->reg.vertex[from], brw_vue_slot_to_offset(i)));
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 6353ca1..ebe8f59 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -390,7 +390,7 @@ struct interpolation_mode_map {
 static inline bool brw_any_flat_varyings(struct interpolation_mode_map *map)
 {
    for (int i = 0; i < BRW_VARYING_SLOT_COUNT; i++)
-      if (map->mode[i] == INTERP_QUALIFIER_FLAT)
+      if (map->mode[i] == INTERP_MODE_FLAT)
          return true;
 
    return false;
@@ -399,7 +399,7 @@ static inline bool brw_any_flat_varyings(struct interpolation_mode_map *map)
 static inline bool brw_any_noperspective_varyings(struct interpolation_mode_map *map)
 {
    for (int i = 0; i < BRW_VARYING_SLOT_COUNT; i++)
-      if (map->mode[i] == INTERP_QUALIFIER_NOPERSPECTIVE)
+      if (map->mode[i] == INTERP_MODE_NOPERSPECTIVE)
          return true;
 
    return false;
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index d4e5e86..c907725 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1071,13 +1071,13 @@ fs_visitor::emit_fragcoord_interpolation()
 }
 
 static enum brw_barycentric_mode
-barycentric_mode(enum glsl_interp_qualifier mode,
+barycentric_mode(enum glsl_interp_mode mode,
                  bool is_centroid, bool is_sample)
 {
    unsigned bary;
 
    /* Barycentric modes don't make sense for flat inputs. */
-   assert(mode != INTERP_QUALIFIER_FLAT);
+   assert(mode != INTERP_MODE_FLAT);
 
    if (is_sample) {
       bary = BRW_BARYCENTRIC_PERSPECTIVE_SAMPLE;
@@ -1087,7 +1087,7 @@ barycentric_mode(enum glsl_interp_qualifier mode,
       bary = BRW_BARYCENTRIC_PERSPECTIVE_PIXEL;
    }
 
-   if (mode == INTERP_QUALIFIER_NOPERSPECTIVE)
+   if (mode == INTERP_MODE_NOPERSPECTIVE)
       bary += 3;
 
    return (enum brw_barycentric_mode) bary;
@@ -1107,7 +1107,7 @@ centroid_to_pixel(enum brw_barycentric_mode bary)
 void
 fs_visitor::emit_general_interpolation(fs_reg *attr, const char *name,
                                        const glsl_type *type,
-                                       glsl_interp_qualifier interpolation_mode,
+                                       glsl_interp_mode interpolation_mode,
                                        int *location, bool mod_centroid,
                                        bool mod_sample)
 {
@@ -1142,7 +1142,7 @@ fs_visitor::emit_general_interpolation(fs_reg *attr, const char *name,
 
       attr->type = brw_type_for_base_type(type->get_scalar_type());
 
-      if (interpolation_mode == INTERP_QUALIFIER_FLAT) {
+      if (interpolation_mode == INTERP_MODE_FLAT) {
          /* Constant interpolation (flat shading) case. The SF has
           * handed us defined values in only the constant offset
           * field of the setup reg.
@@ -1198,7 +1198,7 @@ fs_visitor::emit_general_interpolation(fs_reg *attr, const char *name,
             } else {
                bld.emit(FS_OPCODE_LINTERP, *attr, delta_xy[bary], interp);
             }
-            if (devinfo->gen < 6 && interpolation_mode == INTERP_QUALIFIER_SMOOTH) {
+            if (devinfo->gen < 6 && interpolation_mode == INTERP_MODE_SMOOTH) {
                bld.MUL(*attr, *attr, this->pixel_w);
             }
             *attr = offset(*attr, bld, 1);
@@ -6347,7 +6347,7 @@ brw_compute_barycentric_interp_modes(const struct brw_device_info *devinfo,
          continue;
 
       /* Flat inputs don't need barycentric modes. */
-      if (var->data.interpolation == INTERP_QUALIFIER_FLAT)
+      if (var->data.interpolation == INTERP_MODE_FLAT)
          continue;
 
       /* Determine the set (or sets) of barycentric coordinates needed to
@@ -6357,7 +6357,7 @@ brw_compute_barycentric_interp_modes(const struct brw_device_info *devinfo,
        * for lit pixels, so we need both sets of barycentric coordinates.
        */
       enum brw_barycentric_mode bary_mode =
-         barycentric_mode((glsl_interp_qualifier) var->data.interpolation,
+         barycentric_mode((glsl_interp_mode) var->data.interpolation,
                           var->data.centroid, var->data.sample);
 
       barycentric_interp_modes |= 1 << bary_mode;
@@ -6382,7 +6382,7 @@ brw_compute_flat_inputs(struct brw_wm_prog_data *prog_data,
 	 continue;
 
       /* flat shading */
-      if (var->data.interpolation == INTERP_QUALIFIER_FLAT)
+      if (var->data.interpolation == INTERP_MODE_FLAT)
          prog_data->flat_inputs |= (1 << input_index);
    }
 }
@@ -6423,18 +6423,18 @@ brw_nir_set_default_interpolation(const struct brw_device_info *devinfo,
        * Everything defaults to smooth except for the legacy GL color
        * built-in variables, which might be flat depending on API state.
        */
-      if (var->data.interpolation == INTERP_QUALIFIER_NONE) {
+      if (var->data.interpolation == INTERP_MODE_NONE) {
          const bool flat = api_flat_shade &&
             (var->data.location == VARYING_SLOT_COL0 ||
              var->data.location == VARYING_SLOT_COL1);
 
-         var->data.interpolation = flat ? INTERP_QUALIFIER_FLAT
-                                        : INTERP_QUALIFIER_SMOOTH;
+         var->data.interpolation = flat ? INTERP_MODE_FLAT
+                                        : INTERP_MODE_SMOOTH;
       }
 
       /* Apply 'sample' if necessary for API state. */
       if (per_sample_interpolation &&
-          var->data.interpolation != INTERP_QUALIFIER_FLAT) {
+          var->data.interpolation != INTERP_MODE_FLAT) {
          var->data.centroid = false;
          var->data.sample = true;
       }
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index 70e3249..29c13cd 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -176,7 +176,7 @@ public:
    fs_reg *emit_samplemaskin_setup();
    void emit_general_interpolation(fs_reg *attr, const char *name,
                                    const glsl_type *type,
-                                   glsl_interp_qualifier interpolation_mode,
+                                   glsl_interp_mode interpolation_mode,
                                    int *location, bool mod_centroid,
                                    bool mod_sample);
    fs_reg *emit_vs_system_value(int location);
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index a65c273..a03b057 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -76,7 +76,7 @@ fs_visitor::nir_setup_inputs()
       } else {
          int location = var->data.location;
          emit_general_interpolation(&input, var->name, var->type,
-                                    (glsl_interp_qualifier) var->data.interpolation,
+                                    (glsl_interp_mode) var->data.interpolation,
                                     &location, var->data.centroid,
                                     var->data.sample);
       }
@@ -1639,7 +1639,7 @@ emit_pixel_interpolater_send(const fs_builder &bld,
                              const fs_reg &dst,
                              const fs_reg &src,
                              const fs_reg &desc,
-                             glsl_interp_qualifier interpolation)
+                             glsl_interp_mode interpolation)
 {
    fs_inst *inst;
    fs_reg payload;
@@ -1658,7 +1658,7 @@ emit_pixel_interpolater_send(const fs_builder &bld,
    inst->mlen = mlen;
    /* 2 floats per slot returned */
    inst->regs_written = 2 * bld.dispatch_width() / 8;
-   inst->pi_noperspective = interpolation == INTERP_QUALIFIER_NOPERSPECTIVE;
+   inst->pi_noperspective = interpolation == INTERP_MODE_NOPERSPECTIVE;
 
    return inst;
 }
@@ -3108,8 +3108,8 @@ fs_visitor::nir_emit_fs_intrinsic(const fs_builder &bld,
       wm_prog_data->pulls_bary = true;
 
       fs_reg dst_xy = bld.vgrf(BRW_REGISTER_TYPE_F, 2);
-      const glsl_interp_qualifier interpolation =
-         (glsl_interp_qualifier) instr->variables[0]->var->data.interpolation;
+      const glsl_interp_mode interpolation =
+         (glsl_interp_mode) instr->variables[0]->var->data.interpolation;
 
       switch (instr->intrinsic) {
       case nir_intrinsic_interp_var_at_centroid:
diff --git a/src/mesa/drivers/dri/i965/brw_interpolation_map.c b/src/mesa/drivers/dri/i965/brw_interpolation_map.c
index 87b35d8..6d0a813 100644
--- a/src/mesa/drivers/dri/i965/brw_interpolation_map.c
+++ b/src/mesa/drivers/dri/i965/brw_interpolation_map.c
@@ -26,10 +26,10 @@
 static char const *get_qual_name(int mode)
 {
    switch (mode) {
-      case INTERP_QUALIFIER_NONE:          return "none";
-      case INTERP_QUALIFIER_FLAT:          return "flat";
-      case INTERP_QUALIFIER_SMOOTH:        return "smooth";
-      case INTERP_QUALIFIER_NOPERSPECTIVE: return "nopersp";
+      case INTERP_MODE_NONE:          return "none";
+      case INTERP_MODE_FLAT:          return "flat";
+      case INTERP_MODE_SMOOTH:        return "smooth";
+      case INTERP_MODE_NOPERSPECTIVE: return "nopersp";
       default:                             return "???";
    }
 }
@@ -49,7 +49,7 @@ brw_setup_vue_interpolation(struct brw_context *brw)
                         BRW_NEW_VUE_MAP_GEOM_OUT))
       return;
 
-   memset(&brw->interpolation_mode, INTERP_QUALIFIER_NONE, sizeof(brw->interpolation_mode));
+   memset(&brw->interpolation_mode, INTERP_MODE_NONE, sizeof(brw->interpolation_mode));
 
    brw->ctx.NewDriverState |= BRW_NEW_INTERPOLATION_MAP;
 
@@ -64,7 +64,7 @@ brw_setup_vue_interpolation(struct brw_context *brw)
       /* HPOS always wants noperspective. setting it up here allows
        * us to not need special handling in the SF program. */
       if (varying == VARYING_SLOT_POS) {
-         brw->interpolation_mode.mode[i] = INTERP_QUALIFIER_NOPERSPECTIVE;
+         brw->interpolation_mode.mode[i] = INTERP_MODE_NOPERSPECTIVE;
          continue;
       }
 
@@ -75,17 +75,17 @@ brw_setup_vue_interpolation(struct brw_context *brw)
       if (!(fprog->Base.InputsRead & BITFIELD64_BIT(frag_attrib)))
          continue;
 
-      enum glsl_interp_qualifier mode = fprog->InterpQualifier[frag_attrib];
+      enum glsl_interp_mode mode = fprog->InterpQualifier[frag_attrib];
 
       /* If the mode is not specified, the default varies: Color values
        * follow GL_SHADE_MODEL; everything else is smooth.
        */
-      if (mode == INTERP_QUALIFIER_NONE) {
+      if (mode == INTERP_MODE_NONE) {
          if (frag_attrib == VARYING_SLOT_COL0 || frag_attrib == VARYING_SLOT_COL1)
             mode = brw->ctx.Light.ShadeModel == GL_FLAT
-               ? INTERP_QUALIFIER_FLAT : INTERP_QUALIFIER_SMOOTH;
+               ? INTERP_MODE_FLAT : INTERP_MODE_SMOOTH;
          else
-            mode = INTERP_QUALIFIER_SMOOTH;
+            mode = INTERP_MODE_SMOOTH;
       }
 
       brw->interpolation_mode.mode[i] = mode;
diff --git a/src/mesa/drivers/dri/i965/brw_sf_emit.c b/src/mesa/drivers/dri/i965/brw_sf_emit.c
index f03b741..fe05d54 100644
--- a/src/mesa/drivers/dri/i965/brw_sf_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_sf_emit.c
@@ -162,7 +162,7 @@ static void copy_flatshaded_attributes(struct brw_sf_compile *c,
    int i;
 
    for (i = 0; i < c->vue_map.num_slots; i++) {
-      if (c->key.interpolation_mode.mode[i] == INTERP_QUALIFIER_FLAT) {
+      if (c->key.interpolation_mode.mode[i] == INTERP_MODE_FLAT) {
          brw_MOV(p,
                  get_vue_slot(c, dst, i),
                  get_vue_slot(c, src, i));
@@ -176,7 +176,7 @@ static int count_flatshaded_attributes(struct brw_sf_compile *c)
    int count = 0;
 
    for (i = 0; i < c->vue_map.num_slots; i++)
-      if (c->key.interpolation_mode.mode[i] == INTERP_QUALIFIER_FLAT)
+      if (c->key.interpolation_mode.mode[i] == INTERP_MODE_FLAT)
          count++;
 
    return count;
@@ -336,17 +336,17 @@ calculate_masks(struct brw_sf_compile *c,
                 GLushort *pc_linear)
 {
    bool is_last_attr = (reg == c->nr_setup_regs - 1);
-   enum glsl_interp_qualifier interp;
+   enum glsl_interp_mode interp;
 
    *pc_persp = 0;
    *pc_linear = 0;
    *pc = 0xf;
 
    interp = c->key.interpolation_mode.mode[vert_reg_to_vue_slot(c, reg, 0)];
-   if (interp == INTERP_QUALIFIER_SMOOTH) {
+   if (interp == INTERP_MODE_SMOOTH) {
       *pc_linear = 0xf;
       *pc_persp = 0xf;
-   } else if (interp == INTERP_QUALIFIER_NOPERSPECTIVE)
+   } else if (interp == INTERP_MODE_NOPERSPECTIVE)
       *pc_linear = 0xf;
 
    /* Maybe only processs one attribute on the final round:
@@ -355,10 +355,10 @@ calculate_masks(struct brw_sf_compile *c,
       *pc |= 0xf0;
 
       interp = c->key.interpolation_mode.mode[vert_reg_to_vue_slot(c, reg, 1)];
-      if (interp == INTERP_QUALIFIER_SMOOTH) {
+      if (interp == INTERP_MODE_SMOOTH) {
          *pc_linear |= 0xf0;
          *pc_persp |= 0xf0;
-      } else if (interp == INTERP_QUALIFIER_NOPERSPECTIVE)
+      } else if (interp == INTERP_MODE_NOPERSPECTIVE)
          *pc_linear |= 0xf0;
    }
 
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 29e47de..3dae168 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2031,9 +2031,9 @@ struct gl_fragment_program
    /**
     * GLSL interpolation qualifier associated with each fragment shader input.
     * For inputs that do not have an interpolation qualifier specified in
-    * GLSL, the value is INTERP_QUALIFIER_NONE.
+    * GLSL, the value is INTERP_MODE_NONE.
     */
-   enum glsl_interp_qualifier InterpQualifier[VARYING_SLOT_MAX];
+   enum glsl_interp_mode InterpQualifier[VARYING_SLOT_MAX];
 
    /**
     * Bitfield indicating, for each fragment shader input, 1 if that input
@@ -2638,7 +2638,7 @@ struct gl_shader_variable
    /**
     * Interpolation mode for shader inputs / outputs
     *
-    * \sa glsl_interp_qualifier
+    * \sa glsl_interp_mode
     */
    unsigned interpolation:2;
 
diff --git a/src/mesa/state_tracker/st_nir_lower_builtin.c b/src/mesa/state_tracker/st_nir_lower_builtin.c
index 20b04d1..19a8ac0 100644
--- a/src/mesa/state_tracker/st_nir_lower_builtin.c
+++ b/src/mesa/state_tracker/st_nir_lower_builtin.c
@@ -46,12 +46,12 @@
  *
  * with appropriate substitutions in the uniform variables list:
  *
- *    decl_var uniform INTERP_QUALIFIER_NONE gl_FogParameters gl_Fog (0, 0)
+ *    decl_var uniform INTERP_MODE_NONE gl_FogParameters gl_Fog (0, 0)
  *
  * would become:
  *
- *    decl_var uniform INTERP_QUALIFIER_NONE vec4 state.fog.color (0, 0)
- *    decl_var uniform INTERP_QUALIFIER_NONE vec4 state.fog.params (0, 1)
+ *    decl_var uniform INTERP_MODE_NONE vec4 state.fog.color (0, 0)
+ *    decl_var uniform INTERP_MODE_NONE vec4 state.fog.params (0, 1)
  *
  * See in particular 'struct gl_builtin_uniform_element'.
  */
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 57b0935..ebeed14 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -545,18 +545,18 @@ st_get_vp_variant(struct st_context *st,
 
 
 static unsigned
-st_translate_interp(enum glsl_interp_qualifier glsl_qual, bool is_color)
+st_translate_interp(enum glsl_interp_mode glsl_qual, bool is_color)
 {
    switch (glsl_qual) {
-   case INTERP_QUALIFIER_NONE:
+   case INTERP_MODE_NONE:
       if (is_color)
          return TGSI_INTERPOLATE_COLOR;
       return TGSI_INTERPOLATE_PERSPECTIVE;
-   case INTERP_QUALIFIER_SMOOTH:
+   case INTERP_MODE_SMOOTH:
       return TGSI_INTERPOLATE_PERSPECTIVE;
-   case INTERP_QUALIFIER_FLAT:
+   case INTERP_MODE_FLAT:
       return TGSI_INTERPOLATE_CONSTANT;
-   case INTERP_QUALIFIER_NOPERSPECTIVE:
+   case INTERP_MODE_NOPERSPECTIVE:
       return TGSI_INTERPOLATE_LINEAR;
    default:
       assert(0 && "unexpected interp mode in st_translate_interp()");
-- 
2.9.0



More information about the mesa-dev mailing list