DRI2: Look for flush extension in screen extensions, not driver extensions

This commit is contained in:
Kristian Høgsberg 2009-07-17 03:28:02 -04:00 committed by Jesse Barnes
parent b91597188c
commit 01a443b3b8

View file

@ -173,11 +173,11 @@ __glXDRIdrawableSwapBuffers(__GLXdrawable *drawable)
__GLXDRIdrawable *priv = (__GLXDRIdrawable *) drawable;
__GLXDRIscreen *screen = priv->screen;
(*screen->flush->flushInvalidate)(priv->driDrawable);
if (!DRI2SwapBuffers(drawable->pDraw))
return FALSE;
(*screen->flush->flushInvalidate)(priv->driDrawable);
return TRUE;
}
@ -585,6 +585,14 @@ initializeExtensions(__GLXDRIscreen *screen)
LogMessage(X_INFO, "AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects\n");
}
#endif
#ifdef __DRI2_FLUSH
if (strcmp(extensions[i]->name, __DRI2_FLUSH) == 0 &&
extensions[i]->version >= __DRI2_FLUSH_VERSION) {
screen->flush = (__DRI2flushExtension *) extensions[i];
}
#endif
/* Ignore unknown extensions */
}
}
@ -647,10 +655,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
extensions[i]->version >= __DRI_DRI2_VERSION) {
screen->dri2 = (const __DRIdri2Extension *) extensions[i];
}
if (strcmp(extensions[i]->name, __DRI2_FLUSH) == 0 &&
extensions[i]->version >= __DRI2_FLUSH_VERSION) {
screen->flush = (__DRI2flushExtension *) extensions[i];
}
}
if (screen->core == NULL || screen->dri2 == NULL) {