[Mesa-dev] [PATCH 9/9] radv: dump shader stats when a hang is detected

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Sep 5 19:17:14 UTC 2017


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/amd/vulkan/radv_debug.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c
index f2339dfe71..d9d6b95bb6 100644
--- a/src/amd/vulkan/radv_debug.c
+++ b/src/amd/vulkan/radv_debug.c
@@ -68,6 +68,16 @@ radv_dump_trace(struct radv_device *device, struct radeon_winsys_cs *cs)
 	fclose(f);
 }
 
+static void
+radv_dump_shader(struct radv_device *device,
+		 struct radv_shader_variant *variant, gl_shader_stage stage)
+{
+	fprintf(stderr, "%s:\n", radv_get_shader_name(variant, stage));
+	fprintf(stderr, "\n%s\n\n", variant->binary.disasm_string);
+
+	radv_shader_dump_stats(device, variant, stage, stderr);
+}
+
 static void
 radv_dump_gfx_shaders(struct radv_pipeline *pipeline)
 {
@@ -81,9 +91,7 @@ radv_dump_gfx_shaders(struct radv_pipeline *pipeline)
 		variant = pipeline->shaders[stage];
 		assert(variant);
 
-		fprintf(stderr, "%s:\n%s\n\n",
-			radv_get_shader_name(variant, stage),
-			variant->binary.disasm_string);
+		radv_dump_shader(pipeline->device, variant, stage);
 	}
 }
 
-- 
2.14.1



More information about the mesa-dev mailing list