From: Samuel Pitoiset Date: Fri, 1 Sep 2017 11:45:33 +0000 (+0200) Subject: radv: keep track of the disasm string in debug mode only X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=885d75760b9157f1d84105c979503ec8588470c6;p=mesa.git radv: keep track of the disasm string in debug mode only This will allow to dump the active shaders when a hang is detected. Only the ASM will be dumped for now. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index de7d9a27524..1e25ea378ea 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -425,8 +425,14 @@ shader_variant_create(struct radv_device *device, free(binary.rodata); free(binary.global_symbol_offsets); free(binary.relocs); - free(binary.disasm_string); variant->ref_count = 1; + + if (device->trace_bo) { + variant->disasm_string = binary.disasm_string; + } else { + free(binary.disasm_string); + } + return variant; } @@ -477,6 +483,7 @@ radv_shader_variant_destroy(struct radv_device *device, list_del(&variant->slab_list); mtx_unlock(&device->shader_slab_mutex); + free(variant->disasm_string); free(variant); } diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index 3f8dd92392d..9de3c27550d 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -49,6 +49,7 @@ struct radv_shader_variant { struct ac_shader_variant_info info; unsigned rsrc1; unsigned rsrc2; + char *disasm_string; /* debug only */ struct list_head slab_list; };