diff options
-rw-r--r-- | src/mga_exa.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mga_exa.c b/src/mga_exa.c index ad6f5eb..c5d1705 100644 --- a/src/mga_exa.c +++ b/src/mga_exa.c @@ -386,11 +386,6 @@ mgaCheckComposite(int op, PicturePtr pSrcPict, PicturePtr pMaskPict, return FALSE; if (pMaskPict) { - if (!PICT_FORMAT_A(pMaskPict->format)) { - DEBUG_MSG(("Mask without alpha unsupported\n")); - return FALSE; - } - if (!mgaCheckSourceTexture(1, pMaskPict)) return FALSE; @@ -619,6 +614,15 @@ mgaPrepareComposite(int op, PicturePtr pSrcPict, PicturePtr pMaskPict, blendcntl = (blendcntl & ~MGA_SRC_BLEND_MASK) | MGA_SRC_ZERO; } + if (!PICT_FORMAT_A(pSrcPict->format) && mgaBlendOp[op].src_alpha) { + int dblend = blendcntl & MGA_DST_BLEND_MASK; + + if (dblend == MGA_DST_SRC_ALPHA) + blendcntl = (blendcntl & ~MGA_DST_BLEND_MASK) | MGA_DST_ONE; + else if (dblend == MGA_DST_ONE_MINUS_SRC_ALPHA) + blendcntl = (blendcntl & ~MGA_DST_BLEND_MASK) | MGA_DST_ZERO; + } + WAITFIFO(4); OUTREG(MGAREG_TDUALSTAGE0, ds0); OUTREG(MGAREG_TDUALSTAGE1, ds1); |