gallivm: Swizzle constants into the right AoS ordering.
authorBrian Paul <brianp@vmware.com>
Wed, 2 Feb 2011 14:20:10 +0000 (14:20 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 27 Jan 2012 18:25:32 +0000 (18:25 +0000)
Constants array is always assumed to be RGBA, which means we need to
swizzle the constant elements into place to match the AoS ordering
(e.g., BGRA) that was passed to lp_build_tgsi_aos().

Signed-off-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_tgsi_aos.c

index a021efd69ff8b15c1c45ccac55b577b2c4b32767..74b3b75039aeee668f4743f8ede2d6039e2b58a8 100644 (file)
@@ -189,7 +189,7 @@ emit_fetch(
           * NOTE: constants array is always assumed to be RGBA
           */
 
-         swizzle = lp_build_const_int32(bld->base.gallivm, chan);
+         swizzle = lp_build_const_int32(bld->base.gallivm, bld->swizzles[chan]);
 
          res = LLVMBuildInsertElement(builder, res, scalar, swizzle, "");
       }