summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
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/drivers
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/drivers')
-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
9 files changed, 43 insertions, 43 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;
}