summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-07-21 17:42:01 -0700
committerKenneth Graunke <[email protected]>2016-07-22 20:31:20 -0700
commit0ba7288376dc66f932336862c8a6abb629b47686 (patch)
tree32897a11a2997c672d182798cc9de4a0932679b7
parentf80bea2d8066d228e78a1744d036f69a0265116e (diff)
nir: Lower interp_var_at_* like a normal load_var for flat inputs.
"flat centroid" and "flat sample" both just mean "flat", so we should ignore interpolateAtCentroid/Sample and just return the flat value. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97032 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
-rw-r--r--src/compiler/nir/nir_lower_io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c
index bf8296f5b12..b36836f6f76 100644
--- a/src/compiler/nir/nir_lower_io.c
+++ b/src/compiler/nir/nir_lower_io.c
@@ -340,6 +340,10 @@ lower_interpolate_at(nir_intrinsic_instr *intrin, struct lower_io_state *state,
assert(var->data.mode == nir_var_shader_in);
+ /* Ignore interpolateAt() for flat variables - flat is flat. */
+ if (var->data.interpolation == INTERP_MODE_FLAT)
+ return lower_load(intrin, state, NULL, offset);
+
nir_intrinsic_op bary_op;
switch (intrin->intrinsic) {
case nir_intrinsic_interp_var_at_centroid: