gallium/nir/tgsi: only scan fragment shader inputs for usage_mask
authorDave Airlie <airlied@redhat.com>
Mon, 17 Feb 2020 07:13:58 +0000 (17:13 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 28 Feb 2020 08:33:34 +0000 (18:33 +1000)
The scanner doesn't work with tess shaders, but we don't need it for those,
in fact only frag shaders need it.

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

src/gallium/auxiliary/nir/nir_to_tgsi_info.c

index a761f4460c6a72ccfcd35bc96a68f342889cac03..cc705e75804c6529630defa9a39b748f42bb2563 100644 (file)
@@ -135,10 +135,13 @@ static void gather_intrinsic_load_deref_info(const nir_shader *nir,
 {
    assert(var && var->data.mode == nir_var_shader_in);
 
-   gather_usage(deref, nir_ssa_def_components_read(&instr->dest.ssa),
-               info->input_usage_mask);
+   if (nir->info.stage == MESA_SHADER_FRAGMENT)
+      gather_usage(deref, nir_ssa_def_components_read(&instr->dest.ssa),
+                   info->input_usage_mask);
+
    switch (nir->info.stage) {
    case MESA_SHADER_VERTEX: {
+
       break;
    }
    default: {