diff options
author | Samuel Pitoiset <[email protected]> | 2017-09-01 13:45:33 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-09-08 17:18:17 +0200 |
commit | 885d75760b9157f1d84105c979503ec8588470c6 (patch) | |
tree | a1a1c95f09ce502f887449aca19b5be50f3f5837 | |
parent | 92db23f3f912f207273a90d0850f436e3e95b1d8 (diff) |
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 <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r-- | src/amd/vulkan/radv_shader.c | 9 | ||||
-rw-r--r-- | src/amd/vulkan/radv_shader.h | 1 |
2 files changed, 9 insertions, 1 deletions
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; }; |