radeonsi/nir: set input_interpolate_loc for color inputs
authorMarek Olšák <marek.olsak@amd.com>
Tue, 23 Jul 2019 23:22:57 +0000 (19:22 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 31 Jul 2019 02:06:23 +0000 (22:06 -0400)
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/gallium/drivers/radeonsi/si_shader_nir.c

index df46bb4cadad1b42100ef3411c0cb9537a1efa26..20031ad3f60321298e3ee2827a25146df6871b90 100644 (file)
@@ -552,6 +552,16 @@ void si_nir_scan_shader(const struct nir_shader *nir,
                        if (semantic_name == TGSI_SEMANTIC_PRIMID)
                                info->uses_primid = true;
 
+                       if (semantic_name == TGSI_SEMANTIC_COLOR) {
+                               /* We only need this for color inputs. */
+                               if (variable->data.sample)
+                                       info->input_interpolate_loc[i] = TGSI_INTERPOLATE_LOC_SAMPLE;
+                               else if (variable->data.centroid)
+                                       info->input_interpolate_loc[i] = TGSI_INTERPOLATE_LOC_CENTROID;
+                               else
+                                       info->input_interpolate_loc[i] = TGSI_INTERPOLATE_LOC_CENTER;
+                       }
+
                         enum glsl_base_type base_type =
                                 glsl_get_base_type(glsl_without_array(variable->type));