radv: Add debug option to dump meta shaders.

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>
This commit is contained in:
Timur Kristóf 2019-09-18 14:39:10 +02:00 committed by Connor Abbott
parent a4fd8ba7e3
commit 30f0c0ea7d
3 changed files with 6 additions and 2 deletions

View File

@ -55,6 +55,7 @@ enum {
RADV_DEBUG_NO_NGG = 0x2000000, RADV_DEBUG_NO_NGG = 0x2000000,
RADV_DEBUG_NO_SHADER_BALLOT = 0x4000000, RADV_DEBUG_NO_SHADER_BALLOT = 0x4000000,
RADV_DEBUG_ALL_ENTRYPOINTS = 0x8000000, RADV_DEBUG_ALL_ENTRYPOINTS = 0x8000000,
RADV_DEBUG_DUMP_META_SHADERS = 0x10000000,
}; };
enum { enum {

View File

@ -486,6 +486,7 @@ static const struct debug_control radv_debug_options[] = {
{"nongg", RADV_DEBUG_NO_NGG}, {"nongg", RADV_DEBUG_NO_NGG},
{"noshaderballot", RADV_DEBUG_NO_SHADER_BALLOT}, {"noshaderballot", RADV_DEBUG_NO_SHADER_BALLOT},
{"allentrypoints", RADV_DEBUG_ALL_ENTRYPOINTS}, {"allentrypoints", RADV_DEBUG_ALL_ENTRYPOINTS},
{"metashaders", RADV_DEBUG_DUMP_META_SHADERS},
{NULL, 0} {NULL, 0}
}; };

View File

@ -119,9 +119,11 @@ radv_can_dump_shader(struct radv_device *device,
{ {
if (!(device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS)) if (!(device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS))
return false; 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 is_gs_copy_shader;
return (module && !module->nir) || is_gs_copy_shader;
} }
bool bool