X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Ftdfx%2Ftdfx_context.c;h=973aa6cff21d2d33a09d61d48504ee15a65b2c21;hb=263581bba4d61291c54313648063a30c47106f0b;hp=8dba39b87073e84e975806871ce4451ffb212a1d;hpb=013056ac651383579b1395c18ad96bd0dca620dd;p=mesa.git diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c index 8dba39b8707..973aa6cff21 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c @@ -40,13 +40,13 @@ #include "tdfx_dd.h" #include "tdfx_state.h" #include "tdfx_vb.h" +#include "tdfx_tex.h" #include "tdfx_tris.h" #include "tdfx_render.h" #include "tdfx_span.h" #include "tdfx_texman.h" #include "extensions.h" - #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "array_cache/acache.h" @@ -54,6 +54,8 @@ #include "tnl/tnl.h" #include "tnl/t_pipeline.h" +#include "drivers/common/driverfuncs.h" + const char __driConfigOptions[] = { 0 }; const GLuint __driNConfigOptions = 0; @@ -115,19 +117,29 @@ GLboolean tdfxCreateContext( const __GLcontextModes *mesaVis, tdfxScreenPrivate *fxScreen = (tdfxScreenPrivate *) sPriv->private; TDFXSAREAPriv *saPriv = (TDFXSAREAPriv *) ((char *) sPriv->pSAREA + sizeof(XF86DRISAREARec)); + struct dd_function_table functions; /* Allocate tdfx context */ fxMesa = (tdfxContextPtr) CALLOC( sizeof(tdfxContextRec) ); if (!fxMesa) return GL_FALSE; + /* Init default driver functions then plug in our tdfx-specific functions + * (the texture functions are especially important) + */ + _mesa_init_driver_functions(&functions); + tdfxDDInitDriverFuncs(mesaVis, &functions); + tdfxInitTextureFuncs(&functions); + tdfxInitRenderFuncs(&functions); + /* Allocate the Mesa context */ if (sharedContextPrivate) shareCtx = ((tdfxContextPtr) sharedContextPrivate)->glCtx; else shareCtx = NULL; - fxMesa->glCtx = _mesa_create_context(mesaVis, shareCtx, (void *) fxMesa, GL_TRUE); + fxMesa->glCtx = _mesa_create_context(mesaVis, shareCtx, + &functions, (void *) fxMesa); if (!fxMesa->glCtx) { FREE(fxMesa); return GL_FALSE; @@ -246,10 +258,9 @@ GLboolean tdfxCreateContext( const __GLcontextModes *mesaVis, _swrast_allow_vertex_fog( ctx, GL_FALSE ); tdfxDDInitExtensions( ctx ); - tdfxDDInitDriverFuncs( ctx ); - tdfxDDInitStateFuncs( ctx ); - tdfxDDInitRenderFuncs( ctx ); + /* XXX these should really go right after _mesa_init_driver_functions() */ tdfxDDInitSpanFuncs( ctx ); + tdfxDDInitStateFuncs( ctx ); tdfxDDInitTriFuncs( ctx ); tdfxInitVB( ctx ); tdfxInitState( fxMesa ); @@ -495,7 +506,7 @@ tdfxDestroyContext( __DRIcontextPrivate *driContextPriv ) _mesa_destroy_context(fxMesa->glCtx); /* free the tdfx context */ - XFree( fxMesa ); + FREE( fxMesa ); } }