summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs.cpp
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-09-14 10:39:52 -0700
committerJason Ekstrand <[email protected]>2016-09-15 13:31:43 -0700
commit246db0063eb6e01aad961b1c73d32fca911ae1df (patch)
tree37756813ede92ca36a18b7b311e8163bdbf3378c /src/mesa/drivers/dri/i965/brw_fs.cpp
parented65e6ef49e17e9cae93a8f98e2968346de2bc6e (diff)
i965/fs: Use NIR for handling forced per-sample interpolation
Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp40
1 files changed, 3 insertions, 37 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 2283cffb83b..6deca2621e3 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -6378,8 +6378,7 @@ move_interpolation_to_top(nir_shader *nir)
static void
brw_nir_set_default_interpolation(const struct gen_device_info *devinfo,
struct nir_shader *nir,
- bool api_flat_shade,
- bool per_sample_interpolation)
+ bool api_flat_shade)
{
assert(nir->stage == MESA_SHADER_FRAGMENT);
@@ -6398,13 +6397,6 @@ brw_nir_set_default_interpolation(const struct gen_device_info *devinfo,
: INTERP_MODE_SMOOTH;
}
- /* Apply 'sample' if necessary for API state. */
- if (per_sample_interpolation &&
- var->data.interpolation != INTERP_MODE_FLAT) {
- var->data.centroid = false;
- var->data.sample = true;
- }
-
/* On Ironlake and below, there is only one interpolation mode.
* Centroid interpolation doesn't mean anything on this hardware --
* there is no multisampling.
@@ -6414,32 +6406,6 @@ brw_nir_set_default_interpolation(const struct gen_device_info *devinfo,
var->data.sample = false;
}
}
-
- if (per_sample_interpolation) {
- nir_foreach_block(block, nir_shader_get_entrypoint(nir)) {
- nir_foreach_instr(instr, block) {
- if (instr->type != nir_instr_type_intrinsic)
- continue;
-
- nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
- if (intrin->intrinsic != nir_intrinsic_interp_var_at_centroid)
- continue;
-
- nir_variable *var = intrin->variables[0]->var;
- if (var->data.interpolation == INTERP_MODE_FLAT)
- continue;
-
- /* The description of the interpolateAtCentroid intrinsic is that
- * it interpolates the variable as if it had the "centroid"
- * qualifier. When executing with per_sample_interpolation, this
- * is equivalent to having the "sample" qualifier. Just convert
- * it to a load_var instead.
- */
- assert(var->data.sample);
- intrin->intrinsic = nir_intrinsic_load_var;
- }
- }
- }
}
/**
@@ -6500,8 +6466,8 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,
shader = brw_nir_apply_sampler_key(shader, compiler->devinfo, &key->tex,
true);
brw_nir_set_default_interpolation(compiler->devinfo, shader,
- key->flat_shade, key->persample_interp);
- brw_nir_lower_fs_inputs(shader);
+ key->flat_shade);
+ brw_nir_lower_fs_inputs(shader, key);
brw_nir_lower_fs_outputs(shader);
if (!key->multisample_fbo)
NIR_PASS_V(shader, demote_sample_qualifiers);