radv: gather nir shader info at the end of radv_optimize_nir()
Otherwise, outputs_read/outputs_written might not be up-to-date (mostly after nir_remove_dead_variables) and remove_point_size() might reach an assertion later because the output variable isn't found. It seems better to run nir_shader_gather_info() at the very end of radv_optimize_nir() which can change a lot of things anyways. No fossils-db changes. Cc: mesa-stable Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35707>
This commit is contained in:
committed by
Marge Bot
parent
2e00925c81
commit
30ccd97cd2
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user