summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_shader.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_shader.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_shader.c')
-rw-r--r--src/amd/vulkan/radv_shader.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 349e291b06a..285f42e9377 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -175,7 +175,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
assert(module->size % 4 == 0);
if (device->debug_flags & RADV_DEBUG_DUMP_SPIRV)
- radv_print_spirv(module, stderr);
+ radv_print_spirv(spirv, module->size, stderr);
uint32_t num_spec_entries = 0;
struct nir_spirv_specialization *spec_entries = NULL;
@@ -433,6 +433,8 @@ shader_variant_create(struct radv_device *device,
variant->disasm_string = binary.disasm_string;
if (!gs_copy_shader && !module->nir) {
variant->nir = shader;
+ variant->spirv = (uint32_t *)module->data;
+ variant->spirv_size = module->size;
}
} else {
free(binary.disasm_string);