static void dri2CopySubBuffer(__GLXDRIdrawable *pdraw,
int x, int y, int width, int height)
{
+ __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw;
XRectangle xrect;
XserverRegion region;
xrect.x = x;
- xrect.y = y;
+ xrect.y = priv->height - y - height;
xrect.width = width;
xrect.height = height;
psp->createContext = dri2CreateContext;
psp->createDrawable = dri2CreateDrawable;
psp->swapBuffers = dri2SwapBuffers;
+
+ /* DRI2 suports SubBuffer through DRI2CopyRegion, so it's always
+ * available.*/
psp->copySubBuffer = dri2CopySubBuffer;
+ __glXEnableDirectExtension(psc, "GLX_MESA_copy_sub_buffer");
Xfree(driverName);
Xfree(deviceName);
#ifdef __DRI_COPY_SUB_BUFFER
if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) {
psc->driCopySubBuffer = (__DRIcopySubBufferExtension *) extensions[i];
- __glXEnableDirectExtension(psc, "GLX_MESA_copy_sub_buffer_bit");
+ __glXEnableDirectExtension(psc, "GLX_MESA_copy_sub_buffer");
}
#endif
if ( pdraw != NULL ) {
__GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen);
if (psc->driScreen->copySubBuffer != NULL) {
+ glFlush();
(*psc->driScreen->copySubBuffer)(pdraw, x, y, width, height);
}