summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/mga/mga_xmesa.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-01-20 02:49:27 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-01-20 02:49:27 +0000
commitd3fd7ba8af15bead2f770d68a893449adeb11397 (patch)
tree2c92f7cb35f2776d6c461378f93b556fc1ca080d /src/mesa/drivers/dri/mga/mga_xmesa.c
parent988a8862c8379c0312d40353ee4b35537dff59a1 (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/mga/mga_xmesa.c')
-rw-r--r--src/mesa/drivers/dri/mga/mga_xmesa.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c
index fa8057e732..6c26489d3c 100644
--- a/src/mesa/drivers/dri/mga/mga_xmesa.c
+++ b/src/mesa/drivers/dri/mga/mga_xmesa.c
@@ -40,6 +40,8 @@
#include "tnl/t_pipeline.h"
+#include "drivers/common/driverfuncs.h"
+
#include "mgadd.h"
#include "mgastate.h"
#include "mgatex.h"
@@ -352,6 +354,7 @@ mgaCreateContext( const __GLcontextModes *mesaVis,
mgaScreenPrivate *mgaScreen = (mgaScreenPrivate *)sPriv->private;
MGASAREAPrivPtr saPriv=(MGASAREAPrivPtr)(((char*)sPriv->pSAREA)+
mgaScreen->sarea_priv_offset);
+ struct dd_function_table functions;
if (MGA_DEBUG&DEBUG_VERBOSE_DRI)
fprintf(stderr, "mgaCreateContext\n");
@@ -362,12 +365,21 @@ mgaCreateContext( const __GLcontextModes *mesaVis,
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 );
+ mgaInitDriverFuncs( &functions );
+ mgaInitTextureFuncs( &functions );
+ mgaInitIoctlFuncs( &functions );
+
/* Allocate the Mesa context */
if (sharedContextPrivate)
shareCtx = ((mgaContextPtr) sharedContextPrivate)->glCtx;
else
shareCtx = NULL;
- mmesa->glCtx = _mesa_create_context(mesaVis, shareCtx, (void *) mmesa, GL_TRUE);
+ mmesa->glCtx = _mesa_create_context(mesaVis, shareCtx,
+ &functions, (void *) mmesa);
if (!mmesa->glCtx) {
FREE(mmesa);
return GL_FALSE;
@@ -509,14 +521,16 @@ mgaCreateContext( const __GLcontextModes *mesaVis,
driInitExtensions( ctx, g400_extensions, GL_FALSE );
}
+ /* XXX these should really go right after _mesa_init_driver_functions() */
mgaDDInitStateFuncs( ctx );
- mgaDDInitTextureFuncs( ctx );
mgaDDInitSpanFuncs( ctx );
- mgaDDInitDriverFuncs( ctx );
- mgaDDInitIoctlFuncs( ctx );
mgaDDInitPixelFuncs( ctx );
mgaDDInitTriFuncs( ctx );
+ driInitTextureObjects( ctx, & mmesa->swapped,
+ (DRI_TEXMGR_DO_TEXTURE_2D |
+ DRI_TEXMGR_DO_TEXTURE_RECT) );
+
mgaInitVB( ctx );
mgaInitState( mmesa );