summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-07-07 02:02:38 -0700
committerKenneth Graunke <[email protected]>2016-07-17 19:26:48 -0700
commitac1181ffbef5250cb3b651e047cce5116727c34c (patch)
treeb6aa32932d99fa3dcb15d2435ff63b662b939488 /src/mesa
parente7d96e7685e911b91ce048c6639a4c290faf5d06 (diff)
compiler: Rename INTERP_QUALIFIER_* to INTERP_MODE_*.
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 <[email protected]> Acked-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp_blit.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp_clear.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/brw_clip_util.c6
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h4
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp26
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.h2
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_nir.cpp10
-rw-r--r--src/mesa/drivers/dri/i965/brw_interpolation_map.c20
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf_emit.c14
-rw-r--r--src/mesa/main/mtypes.h6
-rw-r--r--src/mesa/state_tracker/st_nir_lower_builtin.c6
-rw-r--r--src/mesa/state_tracker/st_program.c10
12 files changed, 54 insertions, 54 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 76e771f217f..a54680e5b6b 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 a38ea0c5516..1bc0dbbe756 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 3e6664e4a82..f5d0a5ad946 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 028bffcbd40..bfad868cf87 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -392,7 +392,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;
@@ -401,7 +401,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 d4e5e86e465..c907725d5c5 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 70e324919e1..29c13cd8028 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 129984a8812..ccf0d093f5b 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 87b35d8d59d..6d0a813eee7 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 f03b74143f4..fe05d547fbc 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 29e47debfc2..3dae16895a2 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 20b04d1e20f..19a8ac03139 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 57b09354487..ebeed14ea2e 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()");