summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-04-16 14:08:15 -0600
committerBrian Paul <[email protected]>2010-04-16 14:08:26 -0600
commit862d014ba91f0b959465a48005e94f530f0374a5 (patch)
treec1d8f6627895f140af8b6d1052257d129e754aca /src
parentb2c1b944c9bf7ea08ef3ff6bb0820091903c895c (diff)
llvmpipe: fix color masking
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_fs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index eee4f12bc0e..6aa1e581bb3 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -1117,14 +1117,16 @@ make_variant_key(struct llvmpipe_context *lp,
assert(format_desc->layout == UTIL_FORMAT_COLORSPACE_RGB ||
format_desc->layout == UTIL_FORMAT_COLORSPACE_SRGB);
+ key->blend.rt[i].colormask = lp->blend->rt[i].colormask;
+
/* mask out color channels not present in the color buffer.
* Should be simple to incorporate per-cbuf writemasks:
*/
for(chan = 0; chan < 4; ++chan) {
enum util_format_swizzle swizzle = format_desc->swizzle[chan];
- if(swizzle <= UTIL_FORMAT_SWIZZLE_W)
- key->blend.rt[0].colormask |= (1 << chan);
+ if(swizzle > UTIL_FORMAT_SWIZZLE_W)
+ key->blend.rt[i].colormask &= ~(1 << chan);
}
}