summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_debug.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-09-22 16:56:40 +0200
committerSamuel Pitoiset <[email protected]>2017-10-04 19:37:08 +0200
commit844ae722c4416420f961ce8a89b5e5278865376c (patch)
tree81109e6aa2e0b7cfa4298f280048ae20f8bc9084 /src/amd/vulkan/radv_debug.c
parenta2a350a3be1a4f3dec8cc3264a19eb877d606628 (diff)
radv: dump SPIRV when a GPU hang is detected
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_debug.c')
-rw-r--r--src/amd/vulkan/radv_debug.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c
index 08ee54c9765..cb9509117eb 100644
--- a/src/amd/vulkan/radv_debug.c
+++ b/src/amd/vulkan/radv_debug.c
@@ -497,6 +497,11 @@ radv_dump_shader(struct radv_pipeline *pipeline,
fprintf(f, "%s:\n\n", radv_get_shader_name(shader, stage));
+ if (shader->spirv) {
+ fprintf(f, "SPIRV:\n");
+ radv_print_spirv(shader->spirv, shader->spirv_size, f);
+ }
+
if (shader->nir) {
fprintf(f, "NIR:\n");
nir_print_shader(shader->nir, f);
@@ -700,7 +705,7 @@ radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_winsys_cs *cs)
}
void
-radv_print_spirv(struct radv_shader_module *module, FILE *fp)
+radv_print_spirv(uint32_t *data, uint32_t size, FILE *fp)
{
char path[] = "/tmp/fileXXXXXX";
char line[2048], command[128];
@@ -712,7 +717,7 @@ radv_print_spirv(struct radv_shader_module *module, FILE *fp)
if (fd < 0)
return;
- if (write(fd, module->data, module->size) == -1)
+ if (write(fd, data, size) == -1)
goto fail;
sprintf(command, "spirv-dis %s", path);