anv: move nir_shader_gather_info to anv_pipeline_nir_preprocess
authorMarcin Ślusarz <marcin.slusarz@intel.com>
Fri, 21 Apr 2023 10:51:47 +0000 (12:51 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 24 Apr 2023 08:43:51 +0000 (08:43 +0000)
Fixes dEQP-VK.mesh_shader.ext.misc.custom_attributes*.

Fixes: 16c7c377186 ("anv: move preprocessing of NIR right before compilation")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22629>

src/intel/vulkan/anv_pipeline.c

index 0744d5e..a8f5a2d 100644 (file)
@@ -1815,12 +1815,6 @@ anv_graphics_pipeline_load_nir(struct anv_graphics_base_pipeline *pipeline,
                          stages[s].imported.nir;
       }
 
-      /* We might not have a NIR version of shader if it's coming from a
-       * library.
-       */
-      if (stages[s].nir != NULL)
-         nir_shader_gather_info(stages[s].nir, nir_shader_get_entrypoint(stages[s].nir));
-
       stages[s].feedback.duration += os_time_get_nano() - stage_start;
    }
 
@@ -1896,6 +1890,8 @@ anv_pipeline_nir_preprocess(struct anv_pipeline *pipeline, nir_shader *nir)
       NIR_PASS(_, nir, nir_opt_dce);
       NIR_PASS(_, nir, nir_remove_dead_variables, nir_var_shader_out, NULL);
    }
+
+   nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
 }
 
 static void