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>
* 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, "");
}