Mesa (master): gallivm: Fix indirect immediate registers.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Tue Jul 2 05:31:14 UTC 2013


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

Author: José Fonseca <jfonseca at vmware.com>
Date:   Mon Jul  1 20:54:19 2013 +0100

gallivm: Fix indirect immediate registers.

If reg->Register.Indirect is true then the immediate is not truly a
constant LLVM expression.

There is no performance regression in using LLVMBuildBitCast, as it will
fallback to LLVMConstBitCast internally when the argument is a constant.

Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Reviewed-by: Zack Rusin <zackr at vmware.com>

---

 src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 0bbc408..f641859 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -1026,9 +1026,9 @@ emit_fetch_immediate(
    }
 
    if (stype == TGSI_TYPE_UNSIGNED) {
-      res = LLVMConstBitCast(res, bld_base->uint_bld.vec_type);
+      res = LLVMBuildBitCast(builder, res, bld_base->uint_bld.vec_type, "");
    } else if (stype == TGSI_TYPE_SIGNED) {
-      res = LLVMConstBitCast(res, bld_base->int_bld.vec_type);
+      res = LLVMBuildBitCast(builder, res, bld_base->int_bld.vec_type, "");
    }
    return res;
 }




More information about the mesa-commit mailing list