Mesa (master): gallivm: Fix mask calculation for emit_kill_if.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Tue Nov 19 19:17:11 UTC 2013


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

Author: Si Chen <sichen at vmware.com>
Date:   Thu Nov 14 09:17:13 2013 -0800

gallivm: Fix mask calculation for emit_kill_if.

The exec_mask must be taken in consideration, just like emit_kill above.

The tgsi_exec module has the same bug and should be fixed in a future
change.

Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Reviewed-by: José Fonseca <jfonseca at vmware.com>

---

 src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 3e0fd1c..37f7a56 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -2295,12 +2295,15 @@ emit_kill_if(
       }
    }
 
-   if(mask) {
-      lp_build_mask_update(bld->mask, mask);
-
-      if (!near_end_of_shader(bld, pc))
-	 lp_build_mask_check(bld->mask);
+   if (bld->exec_mask.has_mask) {
+      LLVMValueRef invmask;
+      invmask = LLVMBuildNot(builder, bld->exec_mask.exec_mask, "kilp");
+      mask = LLVMBuildOr(builder, mask, invmask, "");
    }
+
+   lp_build_mask_update(bld->mask, mask);
+   if (!near_end_of_shader(bld, pc))
+      lp_build_mask_check(bld->mask);
 }
 
 




More information about the mesa-commit mailing list