aboutsummaryrefslogtreecommitdiffstats
path: root/src/glx/x11/glxcmds.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2005-07-24 06:29:14 +0000
committerIan Romanick <[email protected]>2005-07-24 06:29:14 +0000
commitc39bf5e273a4995a279ae2af59fc29e06ab47e29 (patch)
tree7b2edd0c9b039d75da7b95c8c97142c31494a03e /src/glx/x11/glxcmds.c
parent7d40d230fa26abeb9f92bdcf8012eddbc585b118 (diff)
All elements of pre-DRI_NEW_INTERFACE_ONLY are removed. This allows
1,402 lines of code to be removed from Mesa (drivers and libGL). The big winner is dri_util.c. Primary changes are: 1. Remove all "deprecated" entry-points from the various structures in dri_interface.h. 2. Rename the remaining fields to removed "version numbers." So, bindContext3 becomes bindContext. Functions with "New" in the name (e.g., CreateNewContext) were *not* changed, but that is an option. Having "New" in the name is less annoying to me than having "3" in the name. 3. Remove all compatibility code that handles cases where the driver or the loader is too old to support the latest interfaces. 4. Append the API version to the __driCreateNewScreen function name. This is currently done by hand. In the future (i.e., the next time we make an incompatible change to the interface) we'll want to come up with a better way to do this. This prevents old loaders from being able to load new (incompatible) drivers. 5. Bump the API version to 20050722. All drivers (by way of dri_util.c) require this version. 6. All drivers are *required* to expose GLX_SGIX_fbconfig and GLX_OML_swap_method (or the moral equivalents). Support for these functions in implicit in the use of the "new" interface. 7. Some cases still exist that need to be compiled differently in a loader or core Mesa versus in a driver. These are identified by the define IN_DRI_DRIVER.
Diffstat (limited to 'src/glx/x11/glxcmds.c')
-rw-r--r--src/glx/x11/glxcmds.c127
1 files changed, 13 insertions, 114 deletions
diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c
index b9fa4eeb451..5a16fb964d3 100644
--- a/src/glx/x11/glxcmds.c
+++ b/src/glx/x11/glxcmds.c
@@ -67,115 +67,6 @@ static const char __glXGLXClientVersion[] = "1.4";
#include "xf86dri.h"
static Bool __glXWindowExists(Display *dpy, GLXDrawable draw);
-
-static void * DriverCreateContextWrapper( const __GLXscreenConfigs *psc,
- Display *dpy, XVisualInfo *vis, void *shared, __DRIcontext *ctx,
- const __GLcontextModes *fbconfig, int render_type );
-
-#ifndef DRI_NEW_INTERFACE_ONLY
-static Bool dummyBindContext2( Display *dpy, int scrn,
- GLXDrawable draw, GLXDrawable read, GLXContext gc );
-
-static Bool dummyUnbindContext2( Display *dpy, int scrn,
- GLXDrawable draw, GLXDrawable read, GLXContext gc );
-
-/****************************************************************************/
-
-/**
- * Used as glue when a driver does not support
- * \c __DRIcontextRec::bindContext2.
- *
- * XXX .bindContext is only defined as a function pointer if
- * !DRI_NEW_INTERFACE_ONLY.
- *
- * \sa DriverCreateContextWrapper, __DRIcontextRec::bindContext2
- */
-static Bool dummyBindContext2( Display *dpy, int scrn,
- GLXDrawable draw, GLXDrawable read,
- GLXContext gc )
-{
- assert( draw == read );
- return (*gc->driContext.bindContext)( dpy, scrn, draw, gc );
-}
-
-/**
- * Used as glue when a driver does not support
- * \c __DRIcontextRec::unbindContext2.
- *
- * XXX .unbindContext is only defined as a function pointer if
- * !DRI_NEW_INTERFACE_ONLY.
- *
- * \sa DriverCreateContextWrapper, __DRIcontextRec::unbindContext2
- */
-static Bool dummyUnbindContext2( Display *dpy, int scrn,
- GLXDrawable draw, GLXDrawable read,
- GLXContext gc )
-{
- assert( draw == read );
- return (*gc->driContext.unbindContext)( dpy, scrn, draw, gc, GL_FALSE );
-}
-#endif /* DRI_NEW_INTERFACE_ONLY */
-
-
-/****************************************************************************/
-/**
- * Wrap the call to the driver's \c createContext function.
- *
- * The \c createContext function is wrapped because not all drivers support
- * the "new" \c unbindContext2 and \c bindContext2 interfaces. libGL should
- * not have to check to see which functions the driver supports. Instead,
- * if either function is not supported it is wrapped. The wrappers test to
- * make sure that both drawables are the same and pass control to the old
- * interface.
- *
- * \sa dummyBindContext2, dummyUnbindContext2,
- * __DRIcontextRec::bindContext2, __DRIcontextRec::unbindContext2
- */
-
-static void * DriverCreateContextWrapper( const __GLXscreenConfigs *psc,
- Display *dpy, XVisualInfo *vis,
- void *shared,
- __DRIcontext *ctx,
- const __GLcontextModes *modes,
- int render_type )
-{
- void * ctx_priv = NULL;
-
- if ( psc->driScreen.createNewContext != NULL ) {
- assert( modes != NULL );
- ctx_priv = (*psc->driScreen.createNewContext)(dpy, modes, render_type,
- shared, ctx);
-
- /* If the driver supports the createNewContext interface, then
- * it MUST also support either the bindContext2 / unbindContext2
- * interface or the bindContext3 / unbindContext3 interface.
- */
-
- assert( (ctx_priv == NULL) || (ctx->unbindContext2 != NULL)
- || (ctx->unbindContext3 != NULL) );
- assert( (ctx_priv == NULL) || (ctx->bindContext2 != NULL)
- || (ctx->bindContext3 != NULL) );
- }
-#ifndef DRI_NEW_INTERFACE_ONLY
- else {
- if ( vis != NULL ) {
- ctx_priv = (*psc->driScreen.createContext)(dpy, vis, shared, ctx);
-
- if ( ctx_priv != NULL ) {
- if ( ctx->unbindContext2 == NULL ) {
- ctx->unbindContext2 = dummyUnbindContext2;
- }
-
- if ( ctx->bindContext2 == NULL ) {
- ctx->bindContext2 = dummyBindContext2;
- }
- }
- }
- }
-#endif
-
- return ctx_priv;
-}
#endif
@@ -469,10 +360,10 @@ CreateContext(Display *dpy, XVisualInfo *vis,
if (psc && psc->driScreen.private) {
void * const shared = (shareList != NULL)
? shareList->driContext.private : NULL;
- gc->driContext.private =
- DriverCreateContextWrapper( psc, dpy, vis, shared,
- &gc->driContext, mode,
- renderType );
+ gc->driContext.private =
+ (*psc->driScreen.createNewContext)( dpy, mode, renderType,
+ shared,
+ &gc->driContext );
if (gc->driContext.private) {
gc->isDirect = GL_TRUE;
gc->screen = mode->screen;
@@ -842,6 +733,12 @@ static Bool __glXIsDirect(Display *dpy, GLXContextID contextID)
return reply.isDirect;
}
+/**
+ * \todo
+ * Shouldn't this function \b always return \c GL_FALSE when
+ * \c GLX_DIRECT_RENDERING is not defined? Do we really need to bother with
+ * the GLX protocol here at all?
+ */
PUBLIC Bool GLX_PREFIX(glXIsDirect)(Display *dpy, GLXContext gc)
{
if (!gc) {
@@ -3052,8 +2949,10 @@ int __glXGetInternalVersion(void)
* 20040415 - Added support for bindContext3 and unbindContext3.
* 20040602 - Add __glXGetDrawableInfo. I though that was there
* months ago. :(
+ * 20050722 - Gut all the old interfaces. This breaks compatability with
+ * any DRI driver built to any previous version.
*/
- return 20040602;
+ return 20050722;
}