diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index c0a90a36331..66e829c83f1 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -34,6 +34,7 @@ #include "si_shader_internal.h" #include "sid.h" #include "ac_shadowed_regs.h" +#include "compiler/nir/nir.h" #include "util/disk_cache.h" #include "util/u_cpu_detect.h" #include "util/u_log.h" @@ -1163,6 +1164,18 @@ static struct pipe_screen *radeonsi_screen_create_impl(struct radeon_winsys *ws, num_comp_lo_threads = 1; } +#ifndef NDEBUG + nir_process_debug_variable(); + + /* Use a single compilation thread if NIR printing is enabled to avoid + * multiple shaders being printed at the same time. + */ + if (NIR_DEBUG(PRINT)) { + num_comp_hi_threads = 1; + num_comp_lo_threads = 1; + } +#endif + num_comp_hi_threads = MIN2(num_comp_hi_threads, ARRAY_SIZE(sscreen->compiler)); num_comp_lo_threads = MIN2(num_comp_lo_threads, ARRAY_SIZE(sscreen->compiler_lowp));