Module: Mesa
Branch: main
Commit: 32dddb90adfd57a5d29025c7d62911daad7cebaf
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=32dddb90adfd57a5d29025c7d62911daad7cebaf

Author: Mike Blumenkrantz <[email protected]>
Date:   Tue Apr 25 10:13:53 2023 -0400

zink: print the type of shader when dumping

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22692>

---

 src/gallium/drivers/zink/zink_compiler.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_compiler.c 
b/src/gallium/drivers/zink/zink_compiler.c
index 41cda4b535f..7bf2d4b9264 100644
--- a/src/gallium/drivers/zink/zink_compiler.c
+++ b/src/gallium/drivers/zink/zink_compiler.c
@@ -3186,13 +3186,13 @@ split_blocks(nir_shader *nir)
 }
 
 static void
-zink_shader_dump(void *words, size_t size, const char *file)
+zink_shader_dump(const struct zink_shader *zs, void *words, size_t size, const 
char *file)
 {
    FILE *fp = fopen(file, "wb");
    if (fp) {
       fwrite(words, 1, size, fp);
       fclose(fp);
-      fprintf(stderr, "wrote '%s'...\n", file);
+      fprintf(stderr, "wrote %s shader '%s'...\n", 
_mesa_shader_stage_to_string(zs->info.stage), file);
    }
 }
 
@@ -3209,7 +3209,7 @@ zink_shader_spirv_compile(struct zink_screen *screen, 
struct zink_shader *zs, st
       char buf[256];
       static int i;
       snprintf(buf, sizeof(buf), "dump%02d.spv", i++);
-      zink_shader_dump(spirv->words, spirv->num_words * sizeof(uint32_t), buf);
+      zink_shader_dump(zs, spirv->words, spirv->num_words * sizeof(uint32_t), 
buf);
    }
 
    sci.sType = VK_STRUCTURE_TYPE_SHADER_CREATE_INFO_EXT;

Reply via email to