summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--glx/glxcmds.c5
-rw-r--r--glx/glxdrawable.h1
-rw-r--r--glx/glxdri2.c13
3 files changed, 16 insertions, 3 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 24ef893b5..71f15442a 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -1132,6 +1132,7 @@ static void
determineTextureTarget(XID glxDrawableID, CARD32 *attribs, CARD32 numAttribs)
{
GLenum target = 0;
+ GLenum format = 0;
int i;
__GLXdrawable *pGlxDraw;
@@ -1148,6 +1149,9 @@ determineTextureTarget(XID glxDrawableID, CARD32 *attribs, CARD32 numAttribs)
break;
}
}
+
+ if (attribs[2 * i] == GLX_TEXTURE_FORMAT_EXT)
+ format = attribs[2 * i + 1];
}
if (!target) {
@@ -1160,6 +1164,7 @@ determineTextureTarget(XID glxDrawableID, CARD32 *attribs, CARD32 numAttribs)
}
pGlxDraw->target = target;
+ pGlxDraw->format = format;
}
int __glXDisp_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
diff --git a/glx/glxdrawable.h b/glx/glxdrawable.h
index 60aacd792..4f61f8b97 100644
--- a/glx/glxdrawable.h
+++ b/glx/glxdrawable.h
@@ -65,6 +65,7 @@ struct __GLXdrawable {
__GLXconfig *config;
GLenum target;
+ GLenum format;
/*
** Event mask
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index f2682d4d9..0b64298ca 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -222,9 +222,16 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
if (texBuffer == NULL)
return Success;
- texBuffer->setTexBuffer(context->driContext,
- glxPixmap->target,
- drawable->driDrawable);
+ if (texBuffer->base.version >= 2 && texBuffer->setTexBuffer2 != NULL) {
+ (*texBuffer->setTexBuffer2)(context->driContext,
+ glxPixmap->target,
+ glxPixmap->format,
+ drawable->driDrawable);
+ } else {
+ texBuffer->setTexBuffer(context->driContext,
+ glxPixmap->target,
+ drawable->driDrawable);
+ }
return Success;
}