intel/compiler: ignore per-primitive attrs when calculating flat input mask
authorMarcin Ślusarz <marcin.slusarz@intel.com>
Thu, 24 Feb 2022 16:06:33 +0000 (17:06 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 25 Feb 2022 22:34:22 +0000 (22:34 +0000)
If we say that per-primitive attributes are flat (which is communicated by
3DSTATE_SBE.ConstantInterpolationEnable), GPU freaks out and applies it
to other (non-flat) attributes.

Fixes: be89ea3231c ("intel/compiler: Handle per-primitive inputs in FS")

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15169>

src/intel/compiler/brw_fs.cpp

index 359262c..46e346e 100644 (file)
@@ -9452,6 +9452,9 @@ brw_compute_flat_inputs(struct brw_wm_prog_data *prog_data,
    prog_data->flat_inputs = 0;
 
    nir_foreach_shader_in_variable(var, shader) {
+      if (var->data.per_primitive)
+         continue;
+
       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];