diff --git a/src/amd/vulkan/radv_pipeline_compute.c b/src/amd/vulkan/radv_pipeline_compute.c index 057abd480fd..7ba48fb5443 100644 --- a/src/amd/vulkan/radv_pipeline_compute.c +++ b/src/amd/vulkan/radv_pipeline_compute.c @@ -102,9 +102,6 @@ radv_compile_cs(struct radv_device *device, struct vk_pipeline_cache *cache, str radv_optimize_nir(cs_stage->nir, cs_stage->key.optimisations_disabled); - /* Gather info again, information such as outputs_read can be out-of-date. */ - nir_shader_gather_info(cs_stage->nir, nir_shader_get_entrypoint(cs_stage->nir)); - /* Run the shader info pass. */ radv_nir_shader_info_init(cs_stage->stage, MESA_SHADER_NONE, &cs_stage->info); radv_nir_shader_info_pass(device, cs_stage->nir, &cs_stage->layout, &cs_stage->key, NULL, RADV_PIPELINE_COMPUTE, diff --git a/src/amd/vulkan/radv_pipeline_graphics.c b/src/amd/vulkan/radv_pipeline_graphics.c index 13e31ce1c6f..23351c8c188 100644 --- a/src/amd/vulkan/radv_pipeline_graphics.c +++ b/src/amd/vulkan/radv_pipeline_graphics.c @@ -2747,8 +2747,6 @@ radv_graphics_shaders_compile(struct radv_device *device, struct vk_pipeline_cac radv_optimize_nir(stages[i].nir, stages[i].key.optimisations_disabled); - /* Gather info again, information such as outputs_read can be out-of-date. */ - nir_shader_gather_info(stages[i].nir, nir_shader_get_entrypoint(stages[i].nir)); radv_nir_lower_io(device, stages[i].nir); stages[i].feedback.duration += os_time_get_nano() - stage_start; diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index d107c6a8147..b21c70962a4 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -226,6 +226,8 @@ radv_optimize_nir(struct nir_shader *shader, bool optimize_conservatively) NIR_PASS(progress, shader, nir_opt_move_discards_to_top); NIR_PASS(progress, shader, nir_opt_move, nir_move_load_ubo); + + nir_shader_gather_info(shader, nir_shader_get_entrypoint(shader)); } void