gallivm: Fix address register swizzle.
authorJosé Fonseca <jfonseca@vmware.com>
Thu, 16 Sep 2010 08:52:20 +0000 (09:52 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 16 Sep 2010 19:20:49 +0000 (20:20 +0100)
We're actually doing a double swizzling:

  indirect_reg->Swizzle[indirect_reg->SwizzleX]

instead of simply

  indirect_reg->SwizzleX

src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c

index cd5b132b41dad739a37ae49380b02dbf3eddedff..0d8d49be2c73af56e0f222709259b4f9531eff2d 100644 (file)
@@ -476,9 +476,8 @@ get_indirect_offsets(struct lp_build_tgsi_soa_context *bld,
                      const struct tgsi_src_register *indirect_reg)
 {
    /* always use X component of address register */
-   const int x = indirect_reg->SwizzleX;
+   unsigned swizzle = indirect_reg->SwizzleX;
    LLVMTypeRef int_vec_type = lp_build_int_vec_type(bld->base.type);
-   uint swizzle = tgsi_util_get_src_register_swizzle(indirect_reg, x);
    LLVMValueRef vec4 = lp_build_const_int_vec(bld->int_bld.type, 4); 
    LLVMValueRef addr_vec;