Mesa (staging/18.1): i965/fs: Flag all slots of a flat input as flat

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 2 18:12:16 UTC 2018


Module: Mesa
Branch: staging/18.1
Commit: 2d14906109b973f9eab9b005bb03514f4d2a9c71
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2d14906109b973f9eab9b005bb03514f4d2a9c71

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Tue Jul 31 05:31:47 2018 -0700

i965/fs: Flag all slots of a flat input as flat

Otherwise, only the first vec4 of a matrix or other complex type will
get marked as flat and we'll interpolate the others.  This was caught by
a dEQP test which started failing because it did a SSO vs. non-SSO
comparison.  Previously, we did the interpolation wrong consistently in
both versions.  However, with one of Tim Arceri's NIR linkingpatches, we
started splitting the matrix input into vectors at link time in the
non-SSO version and it started getting correctly interpolated which
didn't match the broken SSO version.  As of this commit, they both get
correctly interpolated.

Fixes: e61cc87c757f8bc "i965/fs: Add a flat_inputs field to prog_data"
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
(cherry picked from commit 57804efa885074866e1388191b5f48680c6151da)

---

 src/intel/compiler/brw_fs.cpp | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index 9fe2136687..d1c5c27861 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -6834,14 +6834,17 @@ brw_compute_flat_inputs(struct brw_wm_prog_data *prog_data,
    prog_data->flat_inputs = 0;
 
    nir_foreach_variable(var, &shader->inputs) {
-      int input_index = prog_data->urb_setup[var->data.location];
+      unsigned slots = glsl_count_attribute_slots(var->type, false);
+      for (unsigned s = 0; s < slots; s++) {
+         int input_index = prog_data->urb_setup[var->data.location + s];
 
-      if (input_index < 0)
-	 continue;
+         if (input_index < 0)
+            continue;
 
-      /* flat shading */
-      if (var->data.interpolation == INTERP_MODE_FLAT)
-         prog_data->flat_inputs |= (1 << input_index);
+         /* flat shading */
+         if (var->data.interpolation == INTERP_MODE_FLAT)
+            prog_data->flat_inputs |= 1 << input_index;
+      }
    }
 }
 




More information about the mesa-commit mailing list