diff options
author | Samuel Pitoiset <[email protected]> | 2018-05-24 13:09:12 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2018-05-25 11:58:03 +0200 |
commit | 6f0530ecfe9cfe4349dab197397df92dd967c50c (patch) | |
tree | 7b4c6e55a3af61634d8561da16af1cdbfd86f5ed /src/amd | |
parent | 8c406f0b4d904867058deb4e19acd69fd2c38c91 (diff) |
radv: rework how shaders are dumped when generating a hang report
Use a flag for the active stages instead.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/vulkan/radv_debug.c | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c index 72c7c39fcb8..5cdbf5bea9a 100644 --- a/src/amd/vulkan/radv_debug.c +++ b/src/amd/vulkan/radv_debug.c @@ -442,28 +442,22 @@ radv_dump_annotated_shader(struct radv_shader_variant *shader, static void radv_dump_annotated_shaders(struct radv_pipeline *pipeline, - struct radv_shader_variant *compute_shader, - FILE *f) + VkShaderStageFlagBits active_stages, FILE *f) { struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP]; unsigned num_waves = ac_get_wave_info(waves); - unsigned mask; fprintf(f, COLOR_CYAN "The number of active waves = %u" COLOR_RESET "\n\n", num_waves); /* Dump annotated active graphics shaders. */ - mask = pipeline->active_stages; - while (mask) { - int stage = u_bit_scan(&mask); + while (active_stages) { + int stage = u_bit_scan(&active_stages); radv_dump_annotated_shader(pipeline->shaders[stage], stage, waves, num_waves, f); } - radv_dump_annotated_shader(compute_shader, MESA_SHADER_COMPUTE, waves, - num_waves, f); - /* Print waves executing shaders that are not currently bound. */ unsigned i; bool found = false; @@ -521,47 +515,42 @@ radv_dump_shader(struct radv_pipeline *pipeline, static void radv_dump_shaders(struct radv_pipeline *pipeline, - struct radv_shader_variant *compute_shader, FILE *f) + VkShaderStageFlagBits active_stages, FILE *f) { - unsigned mask; - /* Dump active graphics shaders. */ - mask = pipeline->active_stages; - while (mask) { - int stage = u_bit_scan(&mask); + while (active_stages) { + int stage = u_bit_scan(&active_stages); radv_dump_shader(pipeline, pipeline->shaders[stage], stage, f); } - - radv_dump_shader(pipeline, compute_shader, MESA_SHADER_COMPUTE, f); } static void radv_dump_graphics_state(struct radv_pipeline *graphics_pipeline, struct radv_pipeline *compute_pipeline, FILE *f) { - struct radv_shader_variant *compute_shader = - compute_pipeline ? compute_pipeline->shaders[MESA_SHADER_COMPUTE] : NULL; + VkShaderStageFlagBits active_stages; if (!graphics_pipeline) return; - radv_dump_shaders(graphics_pipeline, compute_shader, f); - radv_dump_annotated_shaders(graphics_pipeline, compute_shader, f); + active_stages = graphics_pipeline->active_stages; + + radv_dump_shaders(graphics_pipeline, active_stages, f); + radv_dump_annotated_shaders(graphics_pipeline, active_stages, f); radv_dump_descriptors(graphics_pipeline, f); } static void radv_dump_compute_state(struct radv_pipeline *compute_pipeline, FILE *f) { + VkShaderStageFlagBits active_stages = VK_SHADER_STAGE_COMPUTE_BIT; + if (!compute_pipeline) return; - radv_dump_shaders(compute_pipeline, - compute_pipeline->shaders[MESA_SHADER_COMPUTE], f); - radv_dump_annotated_shaders(compute_pipeline, - compute_pipeline->shaders[MESA_SHADER_COMPUTE], - f); + radv_dump_shaders(compute_pipeline, active_stages, f); + radv_dump_annotated_shaders(compute_pipeline, active_stages, f); radv_dump_descriptors(compute_pipeline, f); } |