typedef struct __DRIinterfaceMethodsRec __DRIinterfaceMethods;
typedef struct __DRIextensionRec __DRIextension;
+typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension;
/*@}*/
const char *name;
};
+/**
+ * Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
+ */
+#define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer"
+struct __DRIcopySubBufferExtensionRec {
+ __DRIextension base;
+ void (*copySubBuffer)(__DRIdrawable *drawable, int x, int y, int w, int h);
+};
+
/**
* \name Functions provided by the driver loader.
* \since Internal API version 20030317.
*/
unsigned swap_interval;
-
- /**
- * Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
- *
- * \since Internal API version 20060314.
- */
- void (*copySubBuffer)(__DRIdrawable *drawable,
- int x, int y, int w, int h);
};
#endif
__glxHashTable *drawHash;
Display *dpy;
int scr;
+
+#ifdef __DRI_COPY_SUB_BUFFER
+ __DRIcopySubBufferExtension *copySubBuffer;
+#endif
+
#endif
/**
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;
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 */
}
}
dPriv->driScreenPriv->DriverAPI.CopySubBuffer(dPriv, x, y, w, h);
}
+const __DRIcopySubBufferExtension driCopySubBufferExtension = {
+ { __DRI_COPY_SUB_BUFFER }, driCopySubBuffer
+};
+
/**
* This is called via __DRIscreenRec's createNewDrawable pointer.
*/
pdraw->frameTracking = NULL;
pdraw->queryFrameTracking = driQueryFrameTracking;
- if (driCompareGLXAPIVersion (20060314) >= 0)
- pdraw->copySubBuffer = driCopySubBuffer;
-
/* This special default value is replaced with the configured
* default value when the drawable is first bound to a direct
* rendering context.
}
/*@}*/
+
static const __DRIextension **
driGetExtensions(__DRIscreen *screen)
{
__DRIscreenPrivate *psp = screen->private;
- static const __DRIextension *extensions[1];
- return extensions;
+ return psp->extensions;
}
/*****************************************************************/
{
__DRIscreenPrivate *psp;
-
+ static const __DRIextension emptyExtensionList[] = { NULL };
dri_interface = interface;
api_ver = internal_api_version;
psp->pDevPriv = frame_buffer->dev_priv;
psp->fbBPP = psp->fbStride * 8 / frame_buffer->width;
+ psp->extensions = emptyExtensionList;
psp->fd = fd;
psp->myNum = scrn;
*/
extern __GLcontextModes *__driDriverInitScreen(__DRIscreenPrivate *psp);
+/**
+ * Extensions.
+ */
+extern const __DRIcopySubBufferExtension driCopySubBufferExtension;
+
/**
* Used by DRI_VALIDATE_DRAWABLE_INFO
*/
/**
* Pointer back to the \c __DRIscreen that contains this structure.
*/
-
__DRIscreen *psc;
+
+ /**
+ * Extensions provided by this driver.
+ */
+ const __DRIextension **extensions;
};
intelPrintSAREA(sarea);
}
+static const __DRIextension *intelExtensions[] = {
+ &driCopySubBufferExtension.base,
+ NULL
+};
-static GLboolean
-intelInitDriver(__DRIscreenPrivate * sPriv)
+
+static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
{
intelScreenPrivate *intelScreen;
I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv;
}
}
+ sPriv->extensions = intelExtensions;
+
if (glx_enable_extension != NULL) {
(*glx_enable_extension) (sPriv->psc, "GLX_SGI_swap_control");
(*glx_enable_extension) (sPriv->psc, "GLX_SGI_video_sync");
intelPrintSAREA(sarea);
}
+static const __DRIextension *intelExtensions[] = {
+ &driCopySubBufferExtension.base,
+ NULL
+};
static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
{
}
}
+ sPriv->extensions = intelExtensions;
+
if (glx_enable_extension != NULL) {
(*glx_enable_extension)( sPriv->psc, "GLX_SGI_swap_control" );
(*glx_enable_extension)( sPriv->psc, "GLX_SGI_video_sync" );
(*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_control" );
(*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_frame_usage" );
(*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" );
- (*glx_enable_extension)( sPriv->psc, "GLX_MESA_copy_sub_buffer" );
}
return GL_TRUE;
return modes;
}
+static const __DRIextension *radeonExtensions[] = {
+ &driCopySubBufferExtension.base,
+ NULL
+};
/* Create the device specific screen private data struct.
*/
dri_priv->log2GARTTexGran;
}
+ sPriv->extensions = radeonExtensions;
+
if ( glx_enable_extension != NULL ) {
if ( screen->irq != 0 ) {
(*glx_enable_extension)( sPriv->psc, "GLX_SGI_swap_control" );
if (IS_R200_CLASS(screen))
(*glx_enable_extension)( sPriv->psc, "GLX_MESA_allocate_memory" );
- (*glx_enable_extension)( sPriv->psc, "GLX_MESA_copy_sub_buffer" );
(*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" );
}