Module: Mesa
Branch: main
Commit: 17861aff9614abfea3b8a8f111a114b26b351915
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=17861aff9614abfea3b8a8f111a114b26b351915

Author: Pierre-Eric Pelloux-Prayer <[email protected]>
Date:   Mon May 17 15:52:49 2021 +0200

radeonsi: enable glsl_correct_derivatives_after_discard by default

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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10522>

---

 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 3e3834a8888..1e45721e073 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))

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to