radv: dump the trap handler shader with RADV_DEBUG=metashaders
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 5 May 2021 19:23:07 +0000 (21:23 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 17 May 2021 15:18:16 +0000 (15:18 +0000)
Help debugging it.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10656>

src/amd/vulkan/radv_shader.c
src/amd/vulkan/radv_shader.h

index 9e2cebc..1eb9c28 100644 (file)
@@ -97,14 +97,14 @@ static const struct nir_shader_compiler_options nir_options = {
 
 bool
 radv_can_dump_shader(struct radv_device *device, struct vk_shader_module *module,
-                     bool is_gs_copy_shader)
+                     bool meta_shader)
 {
    if (!(device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS))
       return false;
    if (module)
       return !module->nir || (device->instance->debug_flags & RADV_DEBUG_DUMP_META_SHADERS);
 
-   return is_gs_copy_shader;
+   return meta_shader;
 }
 
 bool
@@ -1415,7 +1415,7 @@ shader_variant_compile(struct radv_device *device, struct vk_shader_module *modu
    options->family = chip_family;
    options->chip_class = device->physical_device->rad_info.chip_class;
    options->info = &device->physical_device->rad_info;
-   options->dump_shader = radv_can_dump_shader(device, module, gs_copy_shader);
+   options->dump_shader = radv_can_dump_shader(device, module, gs_copy_shader || trap_handler_shader);
    options->dump_preoptir =
       options->dump_shader && device->instance->debug_flags & RADV_DEBUG_PREOPTIR;
    options->record_ir = keep_shader_info;
index 712d1ad..c6097b8 100644 (file)
@@ -467,7 +467,7 @@ unsigned radv_get_max_workgroup_size(enum chip_class chip_class, gl_shader_stage
 const char *radv_get_shader_name(struct radv_shader_info *info, gl_shader_stage stage);
 
 bool radv_can_dump_shader(struct radv_device *device, struct vk_shader_module *module,
-                          bool is_gs_copy_shader);
+                          bool meta_shader);
 
 bool radv_can_dump_shader_stats(struct radv_device *device, struct vk_shader_module *module);