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/r128/r128_context.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/mesa/drivers/dri/r128/r128_context.c') diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c index d1417c853b5..7bb324473f7 100644 --- a/src/mesa/drivers/dri/r128/r128_context.c +++ b/src/mesa/drivers/dri/r128/r128_context.c @@ -47,6 +47,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/tnl.h" #include "tnl/t_pipeline.h" +#include "drivers/common/driverfuncs.h" + #include "r128_context.h" #include "r128_ioctl.h" #include "r128_dd.h" @@ -97,6 +99,7 @@ GLboolean r128CreateContext( const __GLcontextModes *glVisual, { GLcontext *ctx, *shareCtx; __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; + struct dd_function_table functions; r128ContextPtr rmesa; r128ScreenPtr r128scrn; int i; @@ -106,12 +109,21 @@ GLboolean r128CreateContext( const __GLcontextModes *glVisual, if ( !rmesa ) return GL_FALSE; + /* Init default driver functions then plug in our Radeon-specific functions + * (the texture functions are especially important) + */ + _mesa_init_driver_functions( &functions ); + r128InitDriverFuncs( &functions ); + r128InitIoctlFuncs( &functions ); + r128InitTextureFuncs( &functions ); + /* Allocate the Mesa context */ if (sharedContextPrivate) shareCtx = ((r128ContextPtr) sharedContextPrivate)->glCtx; else shareCtx = NULL; - rmesa->glCtx = _mesa_create_context(glVisual, shareCtx, (void *) rmesa, GL_TRUE); + rmesa->glCtx = _mesa_create_context(glVisual, shareCtx, + &functions, (void *) rmesa); if (!rmesa->glCtx) { FREE(rmesa); return GL_FALSE; @@ -229,13 +241,14 @@ GLboolean r128CreateContext( const __GLcontextModes *glVisual, r128InitVB( ctx ); r128InitTriFuncs( ctx ); - r128DDInitDriverFuncs( ctx ); - r128DDInitIoctlFuncs( ctx ); r128DDInitStateFuncs( ctx ); r128DDInitSpanFuncs( ctx ); - r128DDInitTextureFuncs( ctx ); r128DDInitState( rmesa ); + driInitTextureObjects( ctx, & rmesa->swapped, + DRI_TEXMGR_DO_TEXTURE_1D + | DRI_TEXMGR_DO_TEXTURE_2D ); + rmesa->vblank_flags = (rmesa->r128Screen->irq != 0) ? driGetDefaultVBlankFlags(&rmesa->optionCache) : VBLANK_FLAG_NO_IRQ; -- cgit v1.2.3