Mesa (7.9): gallivm: fix incorrect vector shuffle datatype
Brian Paul
brianp at kemper.freedesktop.org
Mon Sep 20 16:57:20 UTC 2010
Module: Mesa
Branch: 7.9
Commit: febd353bcd198a38d5f5fe7d31162c42bc87b93e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=febd353bcd198a38d5f5fe7d31162c42bc87b93e
Author: Brian Paul <brianp at vmware.com>
Date: Fri Sep 17 12:20:15 2010 -0600
gallivm: fix incorrect vector shuffle datatype
The permutation vector must always be a vector of int32 values.
(cherry picked from commit 3c9f4c7b750ce7e9c60d75dbe186aaaf69e4baab)
---
src/gallium/auxiliary/gallivm/lp_bld_swizzle.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c b/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
index d4d2f2b..1dfbe56 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_swizzle.c
@@ -76,11 +76,15 @@ lp_build_broadcast_scalar(struct lp_build_context *bld,
}
else {
LLVMValueRef res;
+ /* The shuffle vector is always made of int32 elements */
+ struct lp_type i32_vec_type = lp_type_int_vec(32);
+ i32_vec_type.length = type.length;
+
#if HAVE_LLVM >= 0x207
res = LLVMBuildInsertElement(bld->builder, bld->undef, scalar,
LLVMConstInt(LLVMInt32Type(), 0, 0), "");
res = LLVMBuildShuffleVector(bld->builder, res, bld->undef,
- lp_build_const_int_vec(type, 0), "");
+ lp_build_const_int_vec(i32_vec_type, 0), "");
#else
/* XXX: The above path provokes a bug in LLVM 2.6 */
unsigned i;
More information about the mesa-commit
mailing list