glx: Invalidate drawable in glXBindTexImageEXT() if we don't get events
authorKristian Høgsberg <krh@bitplanet.net>
Fri, 21 May 2010 15:51:33 +0000 (11:51 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Sat, 22 May 2010 03:24:37 +0000 (23:24 -0400)
When we don't get invalidate events, we need to invalidate a drawable
before using it for tfp to make sure we have uptodate buffers.

src/glx/dri2_glx.c

index ba546a6..d474738 100644 (file)
@@ -570,8 +570,17 @@ dri2_bind_tex_image(Display * dpy,
 {
    GLXContext gc = __glXGetCurrentContext();
    __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
+    __GLXdisplayPrivate *dpyPriv = __glXInitialize(dpy);
+    __GLXDRIdisplayPrivate *pdp =
+       (__GLXDRIdisplayPrivate *) dpyPriv->dri2Display;
 
    if (pdraw != NULL) {
+
+#if __DRI2_FLUSH_VERSION >= 3
+      if (!pdp->invalidateAvailable && pdraw->psc->f)
+        pdraw->psc->f->invalidate(pdraw->driDrawable);
+#endif
+
       if (pdraw->psc->texBuffer->base.version >= 2 &&
          pdraw->psc->texBuffer->setTexBuffer2 != NULL) {
         (*pdraw->psc->texBuffer->setTexBuffer2) (gc->__driContext,