diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2004-01-20 02:49:27 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2004-01-20 02:49:27 +0000 |
commit | d3fd7ba8af15bead2f770d68a893449adeb11397 (patch) | |
tree | 2c92f7cb35f2776d6c461378f93b556fc1ca080d /src/mesa/drivers/dri/gamma/gamma_context.c | |
parent | 988a8862c8379c0312d40353ee4b35537dff59a1 (diff) |
Before calling _mesa_create_context(), initialize a dd_function_table struct
by calling _mesa_init_driver_functions() and then plugging in the driver-
specific functions.
In particular, make sure ctx->Driver.NewTextureObject points to the
appropriate driver function so that _all_ texture objects are augmented
with the driver-specific data.
Put in a bunch of assertions in the texture-related driver functions that
texObj->DriverData is valid. Remove old dead code in near future.
Diffstat (limited to 'src/mesa/drivers/dri/gamma/gamma_context.c')
-rw-r--r-- | src/mesa/drivers/dri/gamma/gamma_context.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/gamma/gamma_context.c b/src/mesa/drivers/dri/gamma/gamma_context.c index df9bc5b54f..ff3b3a47fe 100644 --- a/src/mesa/drivers/dri/gamma/gamma_context.c +++ b/src/mesa/drivers/dri/gamma/gamma_context.c @@ -33,6 +33,8 @@ #include "tnl/tnl.h" #include "tnl/t_pipeline.h" +#include "drivers/common/driverfuncs.h" + #include "context.h" #include "simple_list.h" #include "imports.h" @@ -75,9 +77,17 @@ GLboolean gammaCreateContext( const __GLcontextModes *glVisual, gammaScreenPtr gammascrn; GLINTSAREADRIPtr saPriv=(GLINTSAREADRIPtr)(((char*)sPriv->pSAREA)+ sizeof(XF86DRISAREARec)); + struct dd_function_table functions; gmesa = (gammaContextPtr) CALLOC( sizeof(*gmesa) ); - if ( !gmesa ) return GL_FALSE; + if (!gmesa) + return GL_FALSE; + + /* Init default driver functions then plug in our gamma-specific functions + * (the texture functions are especially important) + */ + _mesa_init_driver_functions( &functions ); + gammaDDInitTextureFuncs( &functions ); /* Allocate the Mesa context */ if (sharedContextPrivate) @@ -85,7 +95,8 @@ GLboolean gammaCreateContext( const __GLcontextModes *glVisual, else shareCtx = NULL; - gmesa->glCtx = _mesa_create_context(glVisual, shareCtx, (void *) gmesa, GL_TRUE); + gmesa->glCtx = _mesa_create_context(glVisual, shareCtx, + &functions, (void *) gmesa); if (!gmesa->glCtx) { FREE(gmesa); return GL_FALSE; @@ -152,10 +163,10 @@ GLboolean gammaCreateContext( const __GLcontextModes *glVisual, gammaInitVB( ctx ); gammaDDInitExtensions( ctx ); + /* XXX these should really go right after _mesa_init_driver_functions() */ gammaDDInitDriverFuncs( ctx ); gammaDDInitStateFuncs( ctx ); gammaDDInitSpanFuncs( ctx ); - gammaDDInitTextureFuncs( ctx ); gammaDDInitTriFuncs( ctx ); gammaDDInitState( gmesa ); |