nir/tgsi: translate the interp location
authorDave Airlie <airlied@redhat.com>
Thu, 19 Mar 2020 04:25:25 +0000 (14:25 +1000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 6 May 2020 06:20:37 +0000 (06:20 +0000)
translate sample and centroid locations.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>

src/gallium/auxiliary/nir/nir_to_tgsi_info.c

index cc705e75804c6529630defa9a39b748f42bb2563..b9af10f2ca16583db6153cd78cee16fd648f312b 100644 (file)
@@ -530,6 +530,11 @@ void nir_tgsi_scan_shader(const struct nir_shader *nir,
          enum glsl_base_type base_type =
             glsl_get_base_type(glsl_without_array(variable->type));
 
+         if (variable->data.centroid)
+            info->input_interpolate_loc[i] = TGSI_INTERPOLATE_LOC_CENTROID;
+         if (variable->data.sample)
+            info->input_interpolate_loc[i] = TGSI_INTERPOLATE_LOC_SAMPLE;
+
          switch (variable->data.interpolation) {
          case INTERP_MODE_NONE:
             if (glsl_base_type_is_integer(base_type)) {