diff options
author | Samuel Pitoiset <[email protected]> | 2018-04-18 18:53:44 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2018-04-19 09:09:52 +0200 |
commit | 4a698660aef46475e9bb49a03eb1019792f478c2 (patch) | |
tree | 9aceb0184ff55be63149b5f3a322294afc252700 /src/amd/vulkan/radv_debug.c | |
parent | 0e10790558b01f09b9517495f7368860af47ee97 (diff) |
radv: dump the SHA1 of SPIRV in the hang report
Might be useful for debugging purposes, especially when we
want to replace a shader on the fly.
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.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c index 17782ab744b..2e9e0165237 100644 --- a/src/amd/vulkan/radv_debug.c +++ b/src/amd/vulkan/radv_debug.c @@ -29,6 +29,7 @@ #include <stdio.h> #include <sys/utsname.h> +#include "util/mesa-sha1.h" #include "sid.h" #include "gfx9d.h" #include "ac_debug.h" @@ -496,7 +497,13 @@ 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"); + unsigned char sha1[21]; + char sha1buf[41]; + + _mesa_sha1_compute(shader->spirv, shader->spirv_size, sha1); + _mesa_sha1_format(sha1buf, sha1); + + fprintf(f, "SPIRV (sha1: %s):\n", sha1buf); radv_print_spirv(shader->spirv, shader->spirv_size, f); } |