summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorJames Benton <[email protected]>2012-04-25 11:19:07 +0100
committerJosé Fonseca <[email protected]>2012-05-02 10:24:34 +0100
commitc23fd547c060c4137eab0f878a1028c5903384eb (patch)
tree2c366b8811c30a309b324a892000aeeb3f6e0260 /src/gallium/drivers
parent7d1f414103bb294d30cac8fecddff0b2ab694810 (diff)
gallivm: Added lp_build_const_mask_aos_swizzled
Allows the creation of const aos masks which have the mask swizzled to match the correct format. Updated existing mask creation code to use the swizzled version where necessary (tgsi register masks and llvmpipe aos blending). Signed-off-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c b/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c
index e67286baf5e..59d5f545966 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c
@@ -380,16 +380,8 @@ lp_build_blend_aos(struct gallivm_state *gallivm,
if (!fullcolormask) {
LLVMValueRef color_mask;
- unsigned color_mask_swizzle;
- /* Swizzle the color mask to ensure it matches target format */
- color_mask_swizzle =
- ((blend->rt[rt].colormask & (1 << swizzle[0])) >> swizzle[0])
- | (((blend->rt[rt].colormask & (1 << swizzle[1])) >> swizzle[1]) << 1)
- | (((blend->rt[rt].colormask & (1 << swizzle[2])) >> swizzle[2]) << 2)
- | (((blend->rt[rt].colormask & (1 << swizzle[3])) >> swizzle[3]) << 3);
-
- color_mask = lp_build_const_mask_aos(gallivm, bld.base.type, color_mask_swizzle);
+ color_mask = lp_build_const_mask_aos_swizzled(gallivm, bld.base.type, blend->rt[rt].colormask, swizzle);
lp_build_name(color_mask, "color_mask");
/* Combine with input mask if necessary */