Mesa (main): nir/nir_to_tgsi: Add support for "if" statements with !native_integers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Dec 10 13:56:25 UTC 2021


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

Author: Emma Anholt <emma at anholt.net>
Date:   Mon Dec  6 12:25:02 2021 -0800

nir/nir_to_tgsi: Add support for "if" statements with !native_integers

Previously we've only used this on HW that had all ifs lowered.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14096>

---

 src/gallium/auxiliary/nir/nir_to_tgsi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c
index c70bc200070..e8ae4017288 100644
--- a/src/gallium/auxiliary/nir/nir_to_tgsi.c
+++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c
@@ -2324,7 +2324,12 @@ static void
 ntt_emit_if(struct ntt_compile *c, nir_if *if_stmt)
 {
    unsigned label;
-   ureg_UIF(c->ureg, c->if_cond, &label);
+
+   if (c->native_integers)
+      ureg_UIF(c->ureg, c->if_cond, &label);
+   else
+      ureg_IF(c->ureg, c->if_cond, &label);
+
    ntt_emit_cf_list(c, &if_stmt->then_list);
 
    if (!nir_cf_list_is_empty_block(&if_stmt->else_list)) {



More information about the mesa-commit mailing list