Mesa (main): turnip: Add nir_opt_conditional_discard.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 19 19:07:29 UTC 2022


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

Author: Emma Anholt <emma at anholt.net>
Date:   Fri Apr 15 11:17:50 2022 -0700

turnip: Add nir_opt_conditional_discard.

We can easily do discard_if in the backend without control flow, but it
wasn't done in ir3 because the GL frontend already did it for us.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15982>

---

 src/freedreno/vulkan/tu_shader.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/freedreno/vulkan/tu_shader.c b/src/freedreno/vulkan/tu_shader.c
index 2b11c78fa4d..1af0dbaa959 100644
--- a/src/freedreno/vulkan/tu_shader.c
+++ b/src/freedreno/vulkan/tu_shader.c
@@ -132,6 +132,8 @@ tu_spirv_to_nir(struct tu_device *dev,
 
    ir3_optimize_loop(dev->compiler, nir);
 
+   NIR_PASS_V(nir, nir_opt_conditional_discard);
+
    return nir;
 }
 



More information about the mesa-commit mailing list