diff options
Diffstat (limited to 'src/glx')
-rw-r--r-- | src/glx/dri2_glx.c | 6 | ||||
-rw-r--r-- | src/glx/dri3_glx.c | 3 | ||||
-rw-r--r-- | src/glx/drisw_glx.c | 12 |
3 files changed, 8 insertions, 13 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 79f6ecc9933..49659081221 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -1032,17 +1032,14 @@ 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) { + if (dpyPriv != NULL && pdraw != NULL) { psc = (struct dri2_screen *) base->psc; if (psc->texBuffer->base.version >= 3 && @@ -1052,7 +1049,6 @@ dri2_release_tex_image(Display * dpy, GLXDrawable drawable, int buffer) pdraw->driDrawable); } } -#endif } static const struct glx_context_vtable dri2_context_vtable = { diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index b7dac8e67b5..653b1e5c5f6 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -1527,7 +1527,8 @@ dri3_release_tex_image(Display * dpy, GLXDrawable drawable, int buffer) if (pdraw != NULL) { psc = (struct dri3_screen *) base->psc; - if (psc->texBuffer->releaseTexBuffer) + if (psc->texBuffer->base.version >= 3 && + psc->texBuffer->releaseTexBuffer != NULL) (*psc->texBuffer->releaseTexBuffer) (pcp->driContext, pdraw->base.textureTarget, pdraw->driDrawable); diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 33d347a6e16..a77be4e429a 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -342,16 +342,15 @@ drisw_bind_tex_image(Display * dpy, static void drisw_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; + struct drisw_context *pcp = (struct drisw_context *) gc; __GLXDRIdrawable *base = GetGLXDRIDrawable(dpy, drawable); struct glx_display *dpyPriv = __glXInitialize(dpy); - struct dri2_drawable *pdraw = (struct dri2_drawable *) base; - struct dri2_screen *psc; + struct drisw_drawable *pdraw = (struct drisw_drawable *) base; + struct drisw_screen *psc; - if (pdraw != NULL) { - psc = (struct dri2_screen *) base->psc; + if (dpyPriv != NULL && pdraw != NULL) { + psc = (struct drisw_screen *) base->psc; if (!psc->texBuffer) return; @@ -363,7 +362,6 @@ drisw_release_tex_image(Display * dpy, GLXDrawable drawable, int buffer) pdraw->driDrawable); } } -#endif } static const struct glx_context_vtable drisw_context_vtable = { |