nir: properly identify texcoords for lowered IO in nir_lower_drawpixels
authorMarek Olšák <marek.olsak@amd.com>
Fri, 14 Aug 2020 05:54:19 +0000 (01:54 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 24 Aug 2020 19:07:18 +0000 (19:07 +0000)
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6442>

src/compiler/nir/nir_lower_drawpixels.c

index b4b2cfd6b83a0f751861973a006b7010d36ae9ce..147f4a3828c0d9524c2bdb9d551f514de0d6dcd2 100644 (file)
@@ -264,16 +264,8 @@ lower_drawpixels_block(lower_drawpixels_state *state, nir_block *block)
 
          case nir_intrinsic_load_interpolated_input:
          case nir_intrinsic_load_input: {
-            /* The intrinsic doesn't carry the variable. We need to find it
-             * manually.
-             */
-            nir_foreach_shader_in_variable(var, state->b.shader) {
-               if ((var->data.driver_location == nir_intrinsic_base(intr)) &&
-                   (nir_intrinsic_component(intr) >= var->data.location_frac  &&
-                    nir_intrinsic_component(intr) <
-                     (var->data.location_frac + glsl_get_components(var->type))))
-                  lower_texcoord(state, intr);
-            }
+            if (nir_intrinsic_io_semantics(intr).location == VARYING_SLOT_TEX0)
+               lower_texcoord(state, intr);
             break;
          }
          default: