gallivm: fix incorrect vector shuffle datatype
authorBrian Paul <brianp@vmware.com>
Thu, 16 Sep 2010 14:56:22 +0000 (08:56 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 16 Sep 2010 14:56:34 +0000 (08:56 -0600)
The permutation vector must always be a vector of int32 values.

src/gallium/auxiliary/gallivm/lp_bld_swizzle.c

index d4d2f2b307e62d106a607a190e8ed2676e021a01..1dfbe56634ebc23eec932e2c5c3a5924c4dc331d 100644 (file)
@@ -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;