mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
Move enabling of DRI extensions into glxextensions.c
This commit is contained in:
parent
594006d8b2
commit
3eaec7dc5d
3 changed files with 59 additions and 91 deletions
|
|
@ -997,73 +997,6 @@ CallCreateNewScreen(Display *dpy, int scrn, __GLXscreenConfigs *psc,
|
||||||
return psp;
|
return psp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void queryExtensions(__GLXscreenConfigs *psc)
|
|
||||||
{
|
|
||||||
const __DRIextension **extensions;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
extensions = psc->driScreen.getExtensions(&psc->driScreen);
|
|
||||||
for (i = 0; extensions[i]; i++) {
|
|
||||||
#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
|
|
||||||
|
|
||||||
#ifdef __DRI_SWAP_CONTROL
|
|
||||||
if (strcmp(extensions[i]->name, __DRI_SWAP_CONTROL) == 0) {
|
|
||||||
psc->swapControl = (__DRIswapControlExtension *) extensions[i];
|
|
||||||
__glXScrEnableExtension(&psc->driScreen,
|
|
||||||
"GLX_SGI_swap_control");
|
|
||||||
__glXScrEnableExtension(&psc->driScreen,
|
|
||||||
"GLX_MESA_swap_control");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __DRI_ALLOCATE
|
|
||||||
if (strcmp(extensions[i]->name, __DRI_ALLOCATE) == 0) {
|
|
||||||
psc->allocate = (__DRIallocateExtension *) extensions[i];
|
|
||||||
__glXScrEnableExtension(&psc->driScreen,
|
|
||||||
"GLX_SGI_swap_control");
|
|
||||||
__glXScrEnableExtension(&psc->driScreen,
|
|
||||||
"GLX_MESA_swap_control");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __DRI_FRAME_TRACKING
|
|
||||||
if (strcmp(extensions[i]->name, __DRI_FRAME_TRACKING) == 0) {
|
|
||||||
psc->frameTracking = (__DRIframeTrackingExtension *) extensions[i];
|
|
||||||
__glXScrEnableExtension(&psc->driScreen,
|
|
||||||
"GLX_MESA_swap_frame_usage");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __DRI_MEDIA_STREAM_COUNTER
|
|
||||||
if (strcmp(extensions[i]->name, __DRI_MEDIA_STREAM_COUNTER) == 0) {
|
|
||||||
psc->msc = (__DRImediaStreamCounterExtension *) extensions[i];
|
|
||||||
__glXScrEnableExtension(&psc->driScreen,
|
|
||||||
"GLX_SGI_video_sync");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __DRI_SWAP_BUFFER_COUNTER
|
|
||||||
/* No driver supports this at this time and the extension is
|
|
||||||
* not defined in dri_interface.h. Will enable
|
|
||||||
* GLX_OML_sync_control if implemented. */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __DRI_READ_DRAWABLE
|
|
||||||
if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
|
|
||||||
__glXScrEnableExtension(&psc->driScreen,
|
|
||||||
"GLX_SGI_make_current_read");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
/* Ignore unknown extensions */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* GLX_DIRECT_RENDERING */
|
#endif /* GLX_DIRECT_RENDERING */
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1259,7 +1192,7 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv)
|
||||||
& priv->driDisplay,
|
& priv->driDisplay,
|
||||||
priv->driDisplay.createNewScreen[i] );
|
priv->driDisplay.createNewScreen[i] );
|
||||||
if (psc->driScreen.private != NULL)
|
if (psc->driScreen.private != NULL)
|
||||||
queryExtensions(psc);
|
__glXScrEnableDRIExtension(psc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -358,28 +358,66 @@ __glXProcessServerString( const struct extension_info * ext,
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable a named GLX extension on a given screen.
|
|
||||||
* Drivers should not call this function directly. They should instead use
|
|
||||||
* \c glXGetProcAddress to obtain a pointer to the function.
|
|
||||||
*
|
|
||||||
* \param psc Pointer to GLX per-screen record.
|
|
||||||
* \param name Name of the extension to enable.
|
|
||||||
*
|
|
||||||
* \sa glXGetProcAddress
|
|
||||||
*
|
|
||||||
* \since Internal API version 20030813.
|
|
||||||
*/
|
|
||||||
void
|
void
|
||||||
__glXScrEnableExtension( __DRIscreen *driScreen, const char * name )
|
__glXScrEnableDRIExtension(__GLXscreenConfigs *psc)
|
||||||
{
|
{
|
||||||
__GLXscreenConfigs *psc =
|
const __DRIextension **extensions;
|
||||||
containerOf(driScreen, __GLXscreenConfigs, driScreen);
|
int i;
|
||||||
|
|
||||||
__glXExtensionsCtr();
|
__glXExtensionsCtr();
|
||||||
__glXExtensionsCtrScreen(psc);
|
__glXExtensionsCtrScreen(psc);
|
||||||
set_glx_extension( known_glx_extensions, name, strlen( name ), GL_TRUE,
|
|
||||||
psc->direct_support );
|
extensions = psc->driScreen.getExtensions(&psc->driScreen);
|
||||||
|
for (i = 0; extensions[i]; i++) {
|
||||||
|
#ifdef __DRI_COPY_SUB_BUFFER
|
||||||
|
if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) {
|
||||||
|
psc->copySubBuffer = (__DRIcopySubBufferExtension *) extensions[i];
|
||||||
|
SET_BIT(psc->direct_support, MESA_copy_sub_buffer_bit);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __DRI_SWAP_CONTROL
|
||||||
|
if (strcmp(extensions[i]->name, __DRI_SWAP_CONTROL) == 0) {
|
||||||
|
psc->swapControl = (__DRIswapControlExtension *) extensions[i];
|
||||||
|
SET_BIT(psc->direct_support, SGI_swap_control_bit);
|
||||||
|
SET_BIT(psc->direct_support, MESA_swap_control_bit);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __DRI_ALLOCATE
|
||||||
|
if (strcmp(extensions[i]->name, __DRI_ALLOCATE) == 0) {
|
||||||
|
psc->allocate = (__DRIallocateExtension *) extensions[i];
|
||||||
|
SET_BIT(psc->direct_support, MESA_allocate_memory_bit);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __DRI_FRAME_TRACKING
|
||||||
|
if (strcmp(extensions[i]->name, __DRI_FRAME_TRACKING) == 0) {
|
||||||
|
psc->frameTracking = (__DRIframeTrackingExtension *) extensions[i];
|
||||||
|
SET_BIT(psc->direct_support, MESA_swap_frame_usage_bit);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __DRI_MEDIA_STREAM_COUNTER
|
||||||
|
if (strcmp(extensions[i]->name, __DRI_MEDIA_STREAM_COUNTER) == 0) {
|
||||||
|
psc->msc = (__DRImediaStreamCounterExtension *) extensions[i];
|
||||||
|
SET_BIT(psc->direct_support, SGI_video_sync_bit);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __DRI_SWAP_BUFFER_COUNTER
|
||||||
|
/* No driver supports this at this time and the extension is
|
||||||
|
* not defined in dri_interface.h. Will enable
|
||||||
|
* GLX_OML_sync_control if implemented. */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __DRI_READ_DRAWABLE
|
||||||
|
if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
|
||||||
|
SET_BIT(psc->direct_support, SGI_make_current_read_bit);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/* Ignore unknown extensions */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -236,10 +236,7 @@ extern void __glXCalculateUsableExtensions( struct __GLXscreenConfigsRec *psc,
|
||||||
GLboolean display_is_direct_capable, int server_minor_version );
|
GLboolean display_is_direct_capable, int server_minor_version );
|
||||||
|
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
|
extern void __glXScrEnableDRIExtension( struct __GLXscreenConfigsRec *psc );
|
||||||
struct __DRIscreenRec;
|
|
||||||
extern void __glXScrEnableExtension( struct __DRIscreenRec *driScreen, const char * name );
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void __glXCalculateUsableGLExtensions( struct __GLXcontextRec * gc,
|
extern void __glXCalculateUsableGLExtensions( struct __GLXcontextRec * gc,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue