radv: Add debug option to dump meta shaders.
authorTimur Kristóf <timur.kristof@gmail.com>
Wed, 18 Sep 2019 12:39:10 +0000 (14:39 +0200)
committerConnor Abbott <cwabbott0@gmail.com>
Thu, 26 Sep 2019 13:36:49 +0000 (13:36 +0000)
This new option can help debug shader compiler problems when
there are issues with the meta shaders.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_debug.h
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_shader.c

index ca71d535f2adbe016e31199a02abd3cd7574a708..2d35f4e13867bc856abdcaf9e1feb00c10c025e2 100644 (file)
@@ -55,6 +55,7 @@ enum {
        RADV_DEBUG_NO_NGG            = 0x2000000,
        RADV_DEBUG_NO_SHADER_BALLOT  = 0x4000000,
        RADV_DEBUG_ALL_ENTRYPOINTS   = 0x8000000,
+       RADV_DEBUG_DUMP_META_SHADERS = 0x10000000,
 };
 
 enum {
index ea132ee8bc422c856dc2dce414e6fa476c074454..1da49cb6093ef8c03796efeb05d51269517fcdcf 100644 (file)
@@ -486,6 +486,7 @@ static const struct debug_control radv_debug_options[] = {
        {"nongg", RADV_DEBUG_NO_NGG},
        {"noshaderballot", RADV_DEBUG_NO_SHADER_BALLOT},
        {"allentrypoints", RADV_DEBUG_ALL_ENTRYPOINTS},
+       {"metashaders", RADV_DEBUG_DUMP_META_SHADERS},
        {NULL, 0}
 };
 
index eb0886bd1f86923370b0b4d32f36bc0a1ed20408..086f7cd86167eaa7f2ec807a2d8fad40e2278ace 100644 (file)
@@ -119,9 +119,11 @@ radv_can_dump_shader(struct radv_device *device,
 {
        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);
 
-       /* Only dump non-meta shaders, useful for debugging purposes. */
-       return (module && !module->nir) || is_gs_copy_shader;
+       return is_gs_copy_shader;
 }
 
 bool