From: Brian Paul Date: Wed, 2 Feb 2011 14:20:10 +0000 (+0000) Subject: gallivm: Swizzle constants into the right AoS ordering. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8b3c99a5ebbc2f8b586d8ae2bd9aa5c55bbf3f04;p=mesa.git 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 --- diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_aos.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_aos.c index a021efd69ff..74b3b75039a 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_aos.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_aos.c @@ -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, ""); }