Mesa (master): nir/loop_analyze: use nir_const_value.b for boolean results, not u32

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Apr 14 20:26:08 UTC 2019


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

Author: Karol Herbst <kherbst at redhat.com>
Date:   Tue Apr  2 14:12:06 2019 +0200

nir/loop_analyze: use nir_const_value.b for boolean results, not u32

Signed-off-by: Karol Herbst <kherbst at redhat.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/compiler/nir/nir_loop_analyze.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_loop_analyze.c b/src/compiler/nir/nir_loop_analyze.c
index 781dac27bb7..75c15ec63d5 100644
--- a/src/compiler/nir/nir_loop_analyze.c
+++ b/src/compiler/nir/nir_loop_analyze.c
@@ -656,7 +656,7 @@ test_iterations(int32_t iter_int, nir_const_value *step,
    /* Evaluate the loop exit condition */
    nir_const_value result = nir_eval_const_opcode(cond_op, 1, bit_size, src);
 
-   return invert_cond ? (result.u32[0] == 0) : (result.u32[0] != 0);
+   return invert_cond ? !result.b[0] : result.b[0];
 }
 
 static int




More information about the mesa-commit mailing list