nir: add a print_internal debug-flag

It can sometimes be useful to also print the shaders that are marked as
internal, so let's add a flag that lets us do that.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21681>
This commit is contained in:
Erik Faye-Lund
2023-03-03 11:25:04 +01:00
committed by Marge Bot
parent 7c1563aebe
commit c305f97257
2 changed files with 4 additions and 1 deletions

View File

@@ -87,6 +87,8 @@ static const struct debug_named_value nir_debug_control[] = {
"Dump resulting kernel shader after each successful lowering/optimization call" },
{ "print_consts", NIR_DEBUG_PRINT_CONSTS,
"Print const value near each use of const SSA variable" },
{ "print_internal", NIR_DEBUG_PRINT_INTERNAL,
"Print shaders even if they are marked as internal" },
DEBUG_NAMED_VALUE_END
};

View File

@@ -88,6 +88,7 @@ extern bool nir_debug_print_shader[MESA_SHADER_KERNEL + 1];
#define NIR_DEBUG_PRINT_CBS (1u << 18)
#define NIR_DEBUG_PRINT_KS (1u << 19)
#define NIR_DEBUG_PRINT_CONSTS (1u << 20)
#define NIR_DEBUG_PRINT_INTERNAL (1u << 21)
#define NIR_DEBUG_PRINT (NIR_DEBUG_PRINT_VS | \
NIR_DEBUG_PRINT_TCS | \
@@ -4512,7 +4513,7 @@ should_skip_nir(const char *name)
static inline bool
should_print_nir(nir_shader *shader)
{
if (shader->info.internal ||
if ((shader->info.internal && !NIR_DEBUG(PRINT_INTERNAL)) ||
shader->info.stage < 0 ||
shader->info.stage > MESA_SHADER_KERNEL)
return false;