From 17861aff9614abfea3b8a8f111a114b26b351915 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Mon, 17 May 2021 15:52:49 +0200 Subject: [PATCH] radeonsi: enable glsl_correct_derivatives_after_discard by default MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Enabling this option by default allows the nir_opt_move_discards_to_top to be used more often. This is only done for LLVM13+ since doing this on LLVM11 hurts a lot of shaders. Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_pipe.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 3e3834a..1e45721 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -1048,8 +1048,12 @@ static struct pipe_screen *radeonsi_screen_create_impl(struct radeon_winsys *ws, /* Set these flags in debug_flags early, so that the shader cache takes * them into account. + * + * Enable FS_CORRECT_DERIVS_AFTER_KILL by default if LLVM is >= 13. This makes + * nir_opt_move_discards_to_top more effective. */ - if (driQueryOptionb(config->options, "glsl_correct_derivatives_after_discard")) + if (driQueryOptionb(config->options, "glsl_correct_derivatives_after_discard") || + LLVM_VERSION_MAJOR >= 13) sscreen->debug_flags |= DBG(FS_CORRECT_DERIVS_AFTER_KILL); if (sscreen->debug_flags & DBG(INFO)) -- 2.7.4