diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2008-11-03 10:00:54 +0100 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2008-11-03 10:00:54 +0100 |
commit | a7951a4dad902edea76a5cd68f833f0e48ae804b (patch) | |
tree | 7957f09acf2e0559e929444a1cac507baf16d969 /glx | |
parent | f8af66ddb21b4fb1ae5b4f7f852418ca7b0e7aec (diff) |
AIGLX: Allow 2D driver to prevent zero-copy texturing of a pixmap.
The driver can return ~0ULL to achieve this, e.g. if the pixmap doesn't fit
into offscreen storage or if its pixel format isn't supported by the 3D engine
for texturing.
See http://bugs.freedesktop.org/show_bug.cgi?id=17723 or
http://bugs.freedesktop.org/show_bug.cgi?id=12385 .
Diffstat (limited to 'glx')
-rw-r--r-- | glx/glxdri.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/glx/glxdri.c b/glx/glxdri.c index ce098e1e6..c43e7c383 100644 --- a/glx/glxdri.c +++ b/glx/glxdri.c @@ -361,6 +361,21 @@ glxFillAlphaChannel (CARD32 *pixels, CARD32 rowstride, int width, int height) } } +static Bool +testTexOffset(__GLXDRIscreen * const screen, PixmapPtr pPixmap) +{ + Bool ret; + + if (!screen->texOffsetStart || !screen->texOffset) + return FALSE; + + __glXenterServer(GL_FALSE); + ret = screen->texOffsetStart(pPixmap) != ~0ULL; + __glXleaveServer(GL_FALSE); + + return ret; +} + /* * (sticking this here for lack of a better place) * Known issues with the GLX_EXT_texture_from_pixmap implementation: @@ -396,7 +411,7 @@ __glXDRIbindTexImage(__GLXcontext *baseContext, pixmap = (PixmapPtr) glxPixmap->pDraw; - if (screen->texOffsetStart && screen->texOffset) { + if (testTexOffset(screen, pixmap)) { __GLXDRIdrawable **texOffsetOverride = screen->texOffsetOverride; int i, firstEmpty = 16; |