mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-08 06:48:05 +02:00
Fix DRI2 texture target for GLX_EXT_texture_from_pixmap.
Thanks to Dennis Kasprzyk for pointing it out and for reminding me to
commit it.
(cherry picked from commit 9abaad115c)
This commit is contained in:
parent
921cbc5803
commit
4aaf048b5a
1 changed files with 2 additions and 13 deletions
|
|
@ -216,8 +216,6 @@ __glXDRIcontextForceCurrent(__GLXcontext *baseContext)
|
||||||
|
|
||||||
#ifdef __DRI_TEX_BUFFER
|
#ifdef __DRI_TEX_BUFFER
|
||||||
|
|
||||||
#define isPowerOfTwo(n) (((n) & ((n) - 1 )) == 0)
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
__glXDRIbindTexImage(__GLXcontext *baseContext,
|
__glXDRIbindTexImage(__GLXcontext *baseContext,
|
||||||
int buffer,
|
int buffer,
|
||||||
|
|
@ -228,26 +226,17 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
|
||||||
PixmapPtr pixmap;
|
PixmapPtr pixmap;
|
||||||
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
|
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
int w, h, target;
|
|
||||||
|
|
||||||
if (screen->texBuffer == NULL)
|
if (screen->texBuffer == NULL)
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
pixmap = (PixmapPtr) glxPixmap->pDraw;
|
pixmap = (PixmapPtr) glxPixmap->pDraw;
|
||||||
w = pixmap->drawable.width;
|
|
||||||
h = pixmap->drawable.height;
|
|
||||||
|
|
||||||
if (!isPowerOfTwo(w) || !isPowerOfTwo(h))
|
|
||||||
target = GL_TEXTURE_RECTANGLE_ARB;
|
|
||||||
else
|
|
||||||
target = GL_TEXTURE_2D;
|
|
||||||
|
|
||||||
screen->texBuffer->setTexBuffer(&context->driContext,
|
screen->texBuffer->setTexBuffer(&context->driContext,
|
||||||
target,
|
glxPixmap->target,
|
||||||
DRI2GetPixmapHandle(pixmap, &flags),
|
DRI2GetPixmapHandle(pixmap, &flags),
|
||||||
pixmap->drawable.depth,
|
pixmap->drawable.depth,
|
||||||
pixmap->devKind,
|
pixmap->devKind,
|
||||||
h);
|
pixmap->drawable.height);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue