[Nouveau] [PATCH] nv10/exa: Allow component-alpha masks.
Francisco Jerez
currojerez at riseup.net
Sun Oct 4 21:47:44 PDT 2009
Signed-off-by: Francisco Jerez <currojerez at riseup.net>
---
src/nv10_exa.c | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/nv10_exa.c b/src/nv10_exa.c
index 71184b1..62cc9aa 100644
--- a/src/nv10_exa.c
+++ b/src/nv10_exa.c
@@ -97,8 +97,6 @@ static Bool NV10CheckTexture(PicturePtr Picture)
return FALSE;
if (Picture->filter != PictFilterNearest && Picture->filter != PictFilterBilinear)
return FALSE;
- if (Picture->componentAlpha)
- return FALSE;
/* we cannot repeat on NV10 because NPOT textures do not support this. unfortunately. */
if (Picture->repeat != RepeatNone)
/* we can repeat 1x1 textures */
@@ -114,8 +112,6 @@ static Bool NV10CheckBuffer(PicturePtr Picture)
if ((w > 4096) || (h > 4096))
return FALSE;
- if (Picture->componentAlpha)
- return FALSE;
if (!NV10DstFormat(Picture->format))
return FALSE;
return TRUE;
@@ -513,12 +509,14 @@ unsigned int color0 = 0, color1 = 0;
if ( ! mask )
rc0_in_rgb |= B_RGB_ONE;
- else
- if ( mask->format == PICT_x8r8g8b8 ) /*no alpha? ignore it*/
- rc0_in_rgb |= B_RGB_ONE;
- else
- rc0_in_rgb |= 0x00190000; /*B = a_1*/
-
+ else if (mask->componentAlpha && PICT_FORMAT_RGB(mask->format))
+ rc0_in_rgb |= 0x00090000; /*B = rgb_1*/
+ else if (PICT_FORMAT_A(mask->format))
+ rc0_in_rgb |= 0x00190000; /*B = a_1*/
+ else /*no alpha? ignore it*/
+ rc0_in_rgb |= B_RGB_ONE;
+
+
BEGIN_RING(chan, celcius, NV10TCL_RC_IN_ALPHA(0), 6);
OUT_RING (chan, rc0_in_alpha);
OUT_RING (chan, rc1_in_alpha);
--
1.6.3.3
More information about the Nouveau
mailing list