summaryrefslogtreecommitdiff
path: root/src/nv30_exa.c
diff options
context:
space:
mode:
authorMaarten Maathuis <madman2003@gmail.com>2009-09-25 19:49:14 +0200
committerMaarten Maathuis <madman2003@gmail.com>2009-09-25 19:49:14 +0200
commited05bd6dab4fdd1289947154df02cd21c0839574 (patch)
tree07bf49012543593de2c205fc3c0f314a834db319 /src/nv30_exa.c
parentdd7b86cb5351a60f21eee9cf81ae0ef61cf45f13 (diff)
downloadxorg-driver-xf86-video-nouveau-ed05bd6dab4fdd1289947154df02cd21c0839574.tar.gz
nv30/exa: fallback on special case xrgb non-repeat textures
Diffstat (limited to 'src/nv30_exa.c')
-rw-r--r--src/nv30_exa.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/nv30_exa.c b/src/nv30_exa.c
index a77a0f3..9e1524d 100644
--- a/src/nv30_exa.c
+++ b/src/nv30_exa.c
@@ -365,7 +365,7 @@ NV30_SetupSurface(ScrnInfoPtr pScrn, PixmapPtr pPix, PicturePtr pPict)
}
static Bool
-NV30EXACheckCompositeTexture(PicturePtr pPict)
+NV30EXACheckCompositeTexture(PicturePtr pPict, PicturePtr pdPict, int op)
{
nv_pict_texture_format_t *fmt;
int w, h;
@@ -392,6 +392,16 @@ NV30EXACheckCompositeTexture(PicturePtr pPict)
NOUVEAU_FALLBACK("repeat 0x%x not supported (surface %dx%d)\n",
pPict->repeatType,w,h);
+ /* Opengl and Render disagree on what should be sampled outside an XRGB
+ * texture (with no repeating). Opengl has a hardcoded alpha value of
+ * 1.0, while render expects 0.0. We assume that clipping is done for
+ * untranformed sources.
+ */
+ if (NV30PictOp[op].src_alpha && !pPict->repeat &&
+ pPict->transform && (PICT_FORMAT_A(pPict->format) == 0)
+ && (PICT_FORMAT_A(pdPict->format) != 0))
+ NOUVEAU_FALLBACK("REPEAT_NONE unsupported for XRGB source\n");
+
return TRUE;
}
@@ -412,14 +422,14 @@ NV30EXACheckComposite(int op, PicturePtr psPict,
NOUVEAU_FALLBACK("dst picture format 0x%08x not supported\n",
pdPict->format);
- if (!NV30EXACheckCompositeTexture(psPict))
+ if (!NV30EXACheckCompositeTexture(psPict, pdPict, op))
NOUVEAU_FALLBACK("src picture\n");
if (pmPict) {
if (pmPict->componentAlpha &&
PICT_FORMAT_RGB(pmPict->format) &&
opr->src_alpha && opr->src_card_op != BF(ZERO))
NOUVEAU_FALLBACK("mask CA + SA\n");
- if (!NV30EXACheckCompositeTexture(pmPict))
+ if (!NV30EXACheckCompositeTexture(pmPict, pdPict, op))
NOUVEAU_FALLBACK("mask picture\n");
}