summaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/x11/glxclient.h5
-rw-r--r--src/glx/x11/glxcmds.c6
-rw-r--r--src/glx/x11/glxext.c10
3 files changed, 17 insertions, 4 deletions
diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h
index 56973251758..2c730282397 100644
--- a/src/glx/x11/glxclient.h
+++ b/src/glx/x11/glxclient.h
@@ -476,6 +476,11 @@ struct __GLXscreenConfigsRec {
__glxHashTable *drawHash;
Display *dpy;
int scr;
+
+#ifdef __DRI_COPY_SUB_BUFFER
+ __DRIcopySubBufferExtension *copySubBuffer;
+#endif
+
#endif
/**
diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c
index 6b8824d8243..1bc5fff957c 100644
--- a/src/glx/x11/glxcmds.c
+++ b/src/glx/x11/glxcmds.c
@@ -2498,13 +2498,13 @@ static void __glXCopySubBufferMESA(Display *dpy, GLXDrawable drawable,
INT32 *x_ptr, *y_ptr, *w_ptr, *h_ptr;
CARD8 opcode;
-#ifdef GLX_DIRECT_RENDERING
+#ifdef __DRI_COPY_SUB_BUFFER
int screen;
__DRIdrawable *pdraw = GetDRIDrawable( dpy, drawable, & screen );
if ( pdraw != NULL ) {
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen );
- if ( __glXExtensionBitIsEnabled( psc, MESA_copy_sub_buffer_bit ) ) {
- (*pdraw->copySubBuffer)(pdraw, x, y, width, height);
+ if (psc->copySubBuffer != NULL) {
+ (*psc->copySubBuffer->copySubBuffer)(pdraw, x, y, width, height);
}
return;
diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c
index cb187717f1e..d0a7a64445a 100644
--- a/src/glx/x11/glxext.c
+++ b/src/glx/x11/glxext.c
@@ -1019,7 +1019,15 @@ static void queryExtensions(__GLXscreenConfigs *psc)
extensions = psc->driScreen.getExtensions(&psc->driScreen);
for (i = 0; extensions[i]; i++) {
- /* Unknown extension, just ignore... */
+#ifdef __DRI_COPY_SUB_BUFFER
+ if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) {
+ psc->copySubBuffer = (__DRIcopySubBufferExtension *) extensions[i];
+ __glXScrEnableExtension(&psc->driScreen,
+ "GLX_MESA_copy_sub_buffer");
+
+ }
+#endif
+ /* Ignore unknown extensions */
}
}