mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 23:00:11 +01:00
radv: Only generate debug info if required
Fixes: 51f2fa1a5e ("radv: Break up radv_shader_nir_to_asm")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24906>
This commit is contained in:
parent
2a5d8d4cf4
commit
ce4c38ecae
5 changed files with 16 additions and 11 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue