From d3fd7ba8af15bead2f770d68a893449adeb11397 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 20 Jan 2004 02:49:27 +0000 Subject: 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. --- src/mesa/drivers/dri/i810/i810context.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri/i810/i810context.c') diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c index d81431765fa..78698e861c2 100644 --- a/src/mesa/drivers/dri/i810/i810context.c +++ b/src/mesa/drivers/dri/i810/i810context.c @@ -47,6 +47,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/t_pipeline.h" +#include "drivers/common/driverfuncs.h" + #include "i810screen.h" #include "i810_dri.h" @@ -152,6 +154,7 @@ i810CreateContext( const __GLcontextModes *mesaVis, i810ScreenPrivate *i810Screen = (i810ScreenPrivate *)sPriv->private; I810SAREAPtr saPriv = (I810SAREAPtr) (((GLubyte *)sPriv->pSAREA) + i810Screen->sarea_priv_offset); + struct dd_function_table functions; /* Allocate i810 context */ imesa = (i810ContextPtr) CALLOC_STRUCT(i810_context_t); @@ -159,12 +162,20 @@ i810CreateContext( const __GLcontextModes *mesaVis, return GL_FALSE; } + /* Init default driver functions then plug in our I810-specific functions + * (the texture functions are especially important) + */ + _mesa_init_driver_functions( &functions ); + i810InitTextureFuncs( &functions ); + i810InitIoctlFuncs( &functions ); + /* Allocate the Mesa context */ if (sharedContextPrivate) shareCtx = ((i810ContextPtr) sharedContextPrivate)->glCtx; else shareCtx = NULL; - imesa->glCtx = _mesa_create_context(mesaVis, shareCtx, (void*) imesa, GL_TRUE); + imesa->glCtx = _mesa_create_context(mesaVis, shareCtx, + &functions, (void*) imesa); if (!imesa->glCtx) { FREE(imesa); return GL_FALSE; @@ -274,14 +285,15 @@ i810CreateContext( const __GLcontextModes *mesaVis, _math_matrix_ctr( &imesa->ViewportMatrix ); driInitExtensions( ctx, card_extensions, GL_TRUE ); + /* XXX these should really go right after _mesa_init_driver_functions() */ i810InitStateFuncs( ctx ); - i810InitTextureFuncs( ctx ); i810InitTriFuncs( ctx ); i810InitSpanFuncs( ctx ); - i810InitIoctlFuncs( ctx ); i810InitVB( ctx ); i810InitState( ctx ); + driInitTextureObjects( ctx, &imesa->swapped, DRI_TEXMGR_DO_TEXTURE_2D); + #if DO_DEBUG I810_DEBUG = driParseDebugString( getenv( "I810_DEBUG" ), debug_control ); -- cgit v1.2.3