summaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
authorJuan Zhao <juan.j.zhao@intel.com>2011-01-09 12:03:02 -0500
committerKristian Høgsberg <krh@bitplanet.net>2011-01-09 14:55:16 -0500
commite59fa4c46c8857f2e04447777dd197464c95b2cb (patch)
treedc08db1f93c23b4600f2071b7ddc985910a12052 /src/glx
parentfb9c6e681f91c986b7cbe2d6e9f6baceda00c415 (diff)
dri2: release texture image.
Add release function for texture_from_pixmap extension. Some platform need to release texture image for texture_from_pixmap extension, add this interface for those platforms.
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/dri2_glx.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index b0559b24d72..75b1a103f01 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -719,6 +719,27 @@ dri2_bind_tex_image(Display * dpy,
static void
dri2_release_tex_image(Display * dpy, GLXDrawable drawable, int buffer)
{
+#if __DRI_TEX_BUFFER_VERSION >= 3
+ struct glx_context *gc = __glXGetCurrentContext();
+ struct dri2_context *pcp = (struct dri2_context *) gc;
+ __GLXDRIdrawable *base = GetGLXDRIDrawable(dpy, drawable);
+ struct glx_display *dpyPriv = __glXInitialize(dpy);
+ struct dri2_drawable *pdraw = (struct dri2_drawable *) base;
+ struct dri2_display *pdp =
+ (struct dri2_display *) dpyPriv->dri2Display;
+ struct dri2_screen *psc;
+
+ if (pdraw != NULL) {
+ psc = (struct dri2_screen *) base->psc;
+
+ if (psc->texBuffer->base.version >= 3 &&
+ psc->texBuffer->releaseTexBuffer != NULL) {
+ (*psc->texBuffer->releaseTexBuffer) (pcp->driContext,
+ pdraw->base.textureTarget,
+ pdraw->driDrawable);
+ }
+ }
+#endif
}
static const struct glx_context_vtable dri2_context_vtable = {