From: Konstantin Seurer Date: Mon, 28 Aug 2023 13:39:44 +0000 (+0200) Subject: radv: Only generate debug info if required X-Git-Tag: upstream/23.3.3~2624 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce4c38ecae763510173631b6f8b4ba55a1537623;p=platform%2Fupstream%2Fmesa.git radv: Only generate debug info if required Fixes: 51f2fa1a5ef ("radv: Break up radv_shader_nir_to_asm") Reviewed-by: Daniel Schürmann Reviewed-by: Samuel Pitoiset Part-of: --- diff --git a/src/amd/vulkan/radv_pipeline_compute.c b/src/amd/vulkan/radv_pipeline_compute.c index e44ccaa..2649899 100644 --- a/src/amd/vulkan/radv_pipeline_compute.c +++ b/src/amd/vulkan/radv_pipeline_compute.c @@ -166,7 +166,8 @@ radv_compile_cs(struct radv_device *device, struct vk_pipeline_cache *cache, str cs_shader = radv_shader_create(device, cache, *cs_binary, keep_executable_info || dump_shader); - radv_shader_generate_debug_info(device, dump_shader, *cs_binary, cs_shader, &cs_stage->nir, 1, &cs_stage->info); + radv_shader_generate_debug_info(device, dump_shader, keep_executable_info, *cs_binary, cs_shader, &cs_stage->nir, 1, + &cs_stage->info); if (keep_executable_info && cs_stage->spirv.size) { cs_shader->spirv = malloc(cs_stage->spirv.size); diff --git a/src/amd/vulkan/radv_pipeline_graphics.c b/src/amd/vulkan/radv_pipeline_graphics.c index c4742cf..861bcaf 100644 --- a/src/amd/vulkan/radv_pipeline_graphics.c +++ b/src/amd/vulkan/radv_pipeline_graphics.c @@ -2241,7 +2241,8 @@ radv_create_gs_copy_shader(struct radv_device *device, struct vk_pipeline_cache struct radv_shader *copy_shader = radv_shader_create(device, cache, *gs_copy_binary, keep_executable_info || dump_shader); if (copy_shader) - radv_shader_generate_debug_info(device, dump_shader, *gs_copy_binary, copy_shader, &nir, 1, &gs_copy_stage.info); + radv_shader_generate_debug_info(device, dump_shader, keep_executable_info, *gs_copy_binary, copy_shader, &nir, 1, + &gs_copy_stage.info); return copy_shader; } @@ -2283,8 +2284,8 @@ 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, pipeline_key, keep_executable_info, keep_statistic_info); shaders[s] = radv_shader_create(device, cache, binaries[s], keep_executable_info || dump_shader); - radv_shader_generate_debug_info(device, dump_shader, binaries[s], shaders[s], nir_shaders, shader_count, - &stages[s].info); + radv_shader_generate_debug_info(device, dump_shader, keep_executable_info, binaries[s], shaders[s], nir_shaders, + shader_count, &stages[s].info); if (s == MESA_SHADER_GEOMETRY && !stages[s].info.is_ngg) { *gs_copy_shader = radv_create_gs_copy_shader(device, cache, &stages[MESA_SHADER_GEOMETRY], pipeline_key, diff --git a/src/amd/vulkan/radv_pipeline_rt.c b/src/amd/vulkan/radv_pipeline_rt.c index 9e5e998..d06ea9e 100644 --- a/src/amd/vulkan/radv_pipeline_rt.c +++ b/src/amd/vulkan/radv_pipeline_rt.c @@ -434,7 +434,8 @@ radv_rt_nir_to_asm(struct radv_device *device, struct vk_pipeline_cache *cache, shader = radv_shader_create(device, cache, binary, keep_executable_info || dump_shader); if (shader) { - radv_shader_generate_debug_info(device, dump_shader, binary, shader, shaders, num_shaders, &stage->info); + radv_shader_generate_debug_info(device, dump_shader, keep_executable_info, binary, shader, shaders, num_shaders, + &stage->info); if (shader && keep_executable_info && stage->spirv.size) { shader->spirv = malloc(stage->spirv.size); diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index e510ac0..075f6a6 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -2383,11 +2383,12 @@ radv_shader_nir_to_asm(struct radv_device *device, struct radv_shader_stage *pl_ } void -radv_shader_generate_debug_info(struct radv_device *device, bool dump_shader, struct radv_shader_binary *binary, - struct radv_shader *shader, struct nir_shader *const *shaders, int shader_count, - struct radv_shader_info *info) +radv_shader_generate_debug_info(struct radv_device *device, bool dump_shader, bool keep_shader_info, + struct radv_shader_binary *binary, struct radv_shader *shader, + struct nir_shader *const *shaders, int shader_count, struct radv_shader_info *info) { - radv_capture_shader_executable_info(device, shader, shaders, shader_count, binary); + if (dump_shader || keep_shader_info) + radv_capture_shader_executable_info(device, shader, shaders, shader_count, binary); if (dump_shader) { fprintf(stderr, "%s", radv_get_shader_name(info, shaders[0]->info.stage)); diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index 0c53695..9545bff 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -657,8 +657,9 @@ struct radv_shader_binary *radv_shader_nir_to_asm(struct radv_device *device, st const struct radv_pipeline_key *key, bool keep_shader_info, bool keep_statistic_info); -void radv_shader_generate_debug_info(struct radv_device *device, bool dump_shader, struct radv_shader_binary *binary, - struct radv_shader *shader, struct nir_shader *const *shaders, int shader_count, +void radv_shader_generate_debug_info(struct radv_device *device, bool dump_shader, bool keep_shader_info, + struct radv_shader_binary *binary, struct radv_shader *shader, + struct nir_shader *const *shaders, int shader_count, struct radv_shader_info *info); VkResult radv_shader_wait_for_upload(struct radv_device *device, uint64_t seq);