From e2cb562dd1bd79f0e4b1b2597cfb0fa6b5f8c22a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20=C5=9Alusarz?= Date: Thu, 24 Feb 2022 17:06:33 +0100 Subject: [PATCH] intel/compiler: ignore per-primitive attrs when calculating flat input mask 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 Part-of: --- src/intel/compiler/brw_fs.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 359262ca489..46e346ec984 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -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];