From f5428a4181d3d5ff3801ab13e391ec7e081f5ccc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 22 Mar 2023 21:21:31 +0100 Subject: [PATCH] radv/debug: dump ray tracing shaders in case of a hang Part-of: --- src/amd/vulkan/radv_debug.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c index dc5a3a8..9872e3f 100644 --- a/src/amd/vulkan/radv_debug.c +++ b/src/amd/vulkan/radv_debug.c @@ -499,6 +499,17 @@ radv_dump_queue_state(struct radv_queue *queue, const char *dump_dir, FILE *f) radv_dump_shader(device, &graphics_pipeline->base, graphics_pipeline->base.shaders[stage], stage, dump_dir, f); } + } else if (pipeline->type == RADV_PIPELINE_RAY_TRACING) { + struct radv_ray_tracing_pipeline *rt_pipeline = radv_pipeline_to_ray_tracing(pipeline); + for (unsigned i = 0; i < rt_pipeline->stage_count; i++) { + if (radv_ray_tracing_stage_is_compiled(&rt_pipeline->stages[i])) { + struct radv_shader *shader = + container_of(rt_pipeline->stages[i].shader, struct radv_shader, base); + radv_dump_shader(device, pipeline, shader, shader->info.stage, dump_dir, f); + } + } + radv_dump_shader(device, pipeline, pipeline->shaders[MESA_SHADER_INTERSECTION], + MESA_SHADER_INTERSECTION, dump_dir, f); } else { struct radv_compute_pipeline *compute_pipeline = radv_pipeline_to_compute(pipeline); @@ -526,6 +537,17 @@ radv_dump_queue_state(struct radv_queue *queue, const char *dump_dir, FILE *f) radv_dump_annotated_shader(graphics_pipeline->base.shaders[stage], stage, waves, num_waves, f); } + } else if (pipeline->type == RADV_PIPELINE_RAY_TRACING) { + struct radv_ray_tracing_pipeline *rt_pipeline = radv_pipeline_to_ray_tracing(pipeline); + for (unsigned i = 0; i < rt_pipeline->stage_count; i++) { + if (radv_ray_tracing_stage_is_compiled(&rt_pipeline->stages[i])) { + struct radv_shader *shader = + container_of(rt_pipeline->stages[i].shader, struct radv_shader, base); + radv_dump_annotated_shader(shader, shader->info.stage, waves, num_waves, f); + } + } + radv_dump_annotated_shader(pipeline->shaders[MESA_SHADER_INTERSECTION], + MESA_SHADER_INTERSECTION, waves, num_waves, f); } else { struct radv_compute_pipeline *compute_pipeline = radv_pipeline_to_compute(pipeline); -- 2.7.4