glamor: Properly handle mask formats without alpha.

Even if the pixmap's storage has alpha, it may have been uploaded with
garbage in the alpha channel, so we need to force the shader to set
alpha to 1.  This was broken way back in
355334fcd9.

Fixes rendercheck -t composite -f x8r8g8b8.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
Eric Anholt 2016-09-24 14:37:28 +03:00
parent 905c877f09
commit 453f813bb4

View File

@ -868,7 +868,10 @@ glamor_composite_choose_shader(CARD8 op,
goto fail;
}
else {
key.mask = SHADER_MASK_TEXTURE_ALPHA;
if (PICT_FORMAT_A(mask->format))
key.mask = SHADER_MASK_TEXTURE_ALPHA;
else
key.mask = SHADER_MASK_TEXTURE;
}
if (!mask->componentAlpha) {