gallivm: Swizzle constants into the right AoS ordering.

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>
This commit is contained in:
Brian Paul
2011-02-02 14:20:10 +00:00
committed by José Fonseca
parent 07635a4799
commit 8b3c99a5eb
@@ -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, "");
}