Move the copySubBuffer extension over to the new mechanism.
This commit is contained in:
parent
f616a263a2
commit
ac3e838fa7
|
@ -58,6 +58,7 @@ typedef struct __DRIversionRec __DRIversion;
|
|||
typedef struct __DRIinterfaceMethodsRec __DRIinterfaceMethods;
|
||||
|
||||
typedef struct __DRIextensionRec __DRIextension;
|
||||
typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension;
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
@ -73,6 +74,15 @@ struct __DRIextensionRec {
|
|||
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.
|
||||
|
@ -481,14 +491,6 @@ struct __DRIdrawableRec {
|
|||
* \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
|
||||
|
|
|
@ -476,6 +476,11 @@ struct __GLXscreenConfigsRec {
|
|||
__glxHashTable *drawHash;
|
||||
Display *dpy;
|
||||
int scr;
|
||||
|
||||
#ifdef __DRI_COPY_SUB_BUFFER
|
||||
__DRIcopySubBufferExtension *copySubBuffer;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -431,6 +431,10 @@ static void driCopySubBuffer(__DRIdrawable *drawable,
|
|||
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.
|
||||
*/
|
||||
|
@ -493,9 +497,6 @@ static void *driCreateNewDrawable(__DRIscreen *screen,
|
|||
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.
|
||||
|
@ -624,13 +625,13 @@ driCreateNewContext(__DRIscreen *screen, const __GLcontextModes *modes,
|
|||
}
|
||||
/*@}*/
|
||||
|
||||
|
||||
static const __DRIextension **
|
||||
driGetExtensions(__DRIscreen *screen)
|
||||
{
|
||||
__DRIscreenPrivate *psp = screen->private;
|
||||
static const __DRIextension *extensions[1];
|
||||
|
||||
return extensions;
|
||||
return psp->extensions;
|
||||
}
|
||||
|
||||
/*****************************************************************/
|
||||
|
@ -715,7 +716,7 @@ void * __DRI_CREATE_NEW_SCREEN( int scrn, __DRIscreen *psc,
|
|||
|
||||
{
|
||||
__DRIscreenPrivate *psp;
|
||||
|
||||
static const __DRIextension emptyExtensionList[] = { NULL };
|
||||
dri_interface = interface;
|
||||
api_ver = internal_api_version;
|
||||
|
||||
|
@ -747,6 +748,7 @@ void * __DRI_CREATE_NEW_SCREEN( int scrn, __DRIscreen *psc,
|
|||
psp->pDevPriv = frame_buffer->dev_priv;
|
||||
psp->fbBPP = psp->fbStride * 8 / frame_buffer->width;
|
||||
|
||||
psp->extensions = emptyExtensionList;
|
||||
psp->fd = fd;
|
||||
psp->myNum = scrn;
|
||||
|
||||
|
|
|
@ -73,6 +73,11 @@ typedef struct __DRIutilversionRec2 __DRIutilversion2;
|
|||
*/
|
||||
extern __GLcontextModes *__driDriverInitScreen(__DRIscreenPrivate *psp);
|
||||
|
||||
/**
|
||||
* Extensions.
|
||||
*/
|
||||
extern const __DRIcopySubBufferExtension driCopySubBufferExtension;
|
||||
|
||||
/**
|
||||
* Used by DRI_VALIDATE_DRAWABLE_INFO
|
||||
*/
|
||||
|
@ -461,8 +466,12 @@ struct __DRIscreenPrivateRec {
|
|||
/**
|
||||
* Pointer back to the \c __DRIscreen that contains this structure.
|
||||
*/
|
||||
|
||||
__DRIscreen *psc;
|
||||
|
||||
/**
|
||||
* Extensions provided by this driver.
|
||||
*/
|
||||
const __DRIextension **extensions;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -419,9 +419,13 @@ intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen,
|
|||
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;
|
||||
|
@ -522,6 +526,8 @@ 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");
|
||||
|
|
|
@ -264,6 +264,10 @@ intelUpdateScreenFromSAREA(intelScreenPrivate *intelScreen,
|
|||
intelPrintSAREA(sarea);
|
||||
}
|
||||
|
||||
static const __DRIextension *intelExtensions[] = {
|
||||
&driCopySubBufferExtension.base,
|
||||
NULL
|
||||
};
|
||||
|
||||
static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
|
||||
{
|
||||
|
@ -350,13 +354,14 @@ 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;
|
||||
|
|
|
@ -332,6 +332,10 @@ radeonFillInModes( unsigned pixel_bits, unsigned depth_bits,
|
|||
return modes;
|
||||
}
|
||||
|
||||
static const __DRIextension *radeonExtensions[] = {
|
||||
&driCopySubBufferExtension.base,
|
||||
NULL
|
||||
};
|
||||
|
||||
/* Create the device specific screen private data struct.
|
||||
*/
|
||||
|
@ -731,6 +735,8 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
|
|||
dri_priv->log2GARTTexGran;
|
||||
}
|
||||
|
||||
sPriv->extensions = radeonExtensions;
|
||||
|
||||
if ( glx_enable_extension != NULL ) {
|
||||
if ( screen->irq != 0 ) {
|
||||
(*glx_enable_extension)( sPriv->psc, "GLX_SGI_swap_control" );
|
||||
|
@ -742,7 +748,6 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
|
|||
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" );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue