radv: dump NIR for executable info after nir_to_asm

ACO modifies the NIR, most importantly it updates divergence analysis.

Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32990>
This commit is contained in:
Georg Lehmann 2025-01-12 19:24:29 +01:00 committed by Marge Bot
parent 88753ddd1d
commit 4a2884237a
3 changed files with 17 additions and 11 deletions

View file

@ -129,14 +129,15 @@ radv_compile_cs(struct radv_device *device, struct vk_pipeline_cache *cache, str
}
}
char *nir_string = NULL;
if (keep_executable_info || dump_shader)
nir_string = radv_dump_nir_shaders(instance, &cs_stage->nir, 1);
/* Compile NIR shader to AMD assembly. */
*cs_binary =
radv_shader_nir_to_asm(device, cs_stage, &cs_stage->nir, 1, NULL, keep_executable_info, keep_statistic_info);
/* Dump NIR after nir_to_asm, because ACO modifies it. */
char *nir_string = NULL;
if (keep_executable_info || dump_shader)
nir_string = radv_dump_nir_shaders(instance, &cs_stage->nir, 1);
cs_shader = radv_shader_create(device, cache, *cs_binary, skip_shaders_cache || dump_shader);
cs_shader->nir_string = nir_string;

View file

@ -2313,12 +2313,13 @@ radv_create_gs_copy_shader(struct radv_device *device, struct vk_pipeline_cache
if (dump_shader)
simple_mtx_lock(&instance->shader_dump_mtx);
*gs_copy_binary = radv_shader_nir_to_asm(device, &gs_copy_stage, &nir, 1, &key.gfx_state, keep_executable_info,
keep_statistic_info);
char *nir_string = NULL;
if (keep_executable_info || dump_shader)
nir_string = radv_dump_nir_shaders(instance, &nir, 1);
*gs_copy_binary = radv_shader_nir_to_asm(device, &gs_copy_stage, &nir, 1, &key.gfx_state, keep_executable_info,
keep_statistic_info);
struct radv_shader *copy_shader =
radv_shader_create(device, cache, *gs_copy_binary, skip_shaders_cache || dump_shader);
@ -2386,12 +2387,14 @@ radv_graphics_shaders_nir_to_asm(struct radv_device *device, struct vk_pipeline_
}
}
binaries[s] = radv_shader_nir_to_asm(device, &stages[s], nir_shaders, shader_count, gfx_state,
keep_executable_info, keep_statistic_info);
/* Dump NIR after nir_to_asm, because ACO modifies it. */
char *nir_string = NULL;
if (keep_executable_info || dump_shader)
nir_string = radv_dump_nir_shaders(instance, nir_shaders, shader_count);
binaries[s] = radv_shader_nir_to_asm(device, &stages[s], nir_shaders, shader_count, gfx_state,
keep_executable_info, keep_statistic_info);
shaders[s] = radv_shader_create(device, cache, binaries[s], skip_shaders_cache || dump_shader);
shaders[s]->nir_string = nir_string;

View file

@ -452,13 +452,15 @@ radv_rt_nir_to_asm(struct radv_device *device, struct vk_pipeline_cache *cache,
}
}
/* Compile NIR shader to AMD assembly. */
binary =
radv_shader_nir_to_asm(device, stage, shaders, num_shaders, NULL, keep_executable_info, keep_statistic_info);
/* Dump NIR after nir_to_asm, because ACO modifies it. */
char *nir_string = NULL;
if (keep_executable_info || dump_shader)
nir_string = radv_dump_nir_shaders(instance, shaders, num_shaders);
/* Compile NIR shader to AMD assembly. */
binary =
radv_shader_nir_to_asm(device, stage, shaders, num_shaders, NULL, keep_executable_info, keep_statistic_info);
struct radv_shader *shader;
if (replay_block || replayable) {
VkResult result = radv_shader_create_uncached(device, binary, replayable, replay_block, &shader);