mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
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 <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
0e10790558
commit
4a698660ae
1 changed files with 8 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue