From 8984a283389a13f9b4315aa7b7df1eaaa612ba28 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 31 Oct 2007 11:35:50 -0600 Subject: [PATCH] Lift VBO/tnl stuff up out of drivers --- .../drivers/dri/intel_winsys/intel_context.c | 18 +++--------------- src/mesa/drivers/x11/xm_api.c | 11 +++++++++++ src/mesa/state_tracker/st_context.c | 8 ++++++++ 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.c b/src/mesa/drivers/dri/intel_winsys/intel_context.c index 975085b1681..790f67b5520 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_context.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_context.c @@ -30,10 +30,6 @@ #include "context.h" #include "extensions.h" -#include "tnl/tnl.h" -#include "tnl/t_pipeline.h" -#include "tnl/t_vertex.h" - #include "drivers/common/driverfuncs.h" #include "i830_dri.h" @@ -210,11 +206,6 @@ intelCreateContext(const __GLcontextModes * mesaVis, intel->driScreen->myNum, "i915"); - /* Initialize the software rasterizer and helper modules. */ - _vbo_CreateContext(ctx); - _tnl_CreateContext(ctx); - - /* * memory pools */ @@ -230,9 +221,6 @@ intelCreateContext(const __GLcontextModes * mesaVis, intel->driFd = sPriv->fd; intel->driHwLock = (drmLock *) & sPriv->pSAREA->lock; - TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline; - - fthrottle_mode = driQueryOptioni(&intel->optionCache, "fthrottle_mode"); intel->iw.irq_seq = -1; intel->irqsEmitted = 0; @@ -309,8 +297,6 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv) //intel->vtbl.destroy(intel); release_texture_heaps = (intel->ctx.Shared->RefCount == 1); - _tnl_DestroyContext(&intel->ctx); - _vbo_DestroyContext(&intel->ctx); intel_batchbuffer_free(intel->batch); @@ -332,8 +318,10 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv) */ } - /* free the Mesa context */ + /* free the Mesa context data */ _mesa_free_context_data(&intel->ctx); + + st_destroy_context(intel->ctx.st); } } diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 4b31447bbd5..ffe8361d268 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -76,9 +76,11 @@ #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "vbo/vbo.h" +#if 0 #include "tnl/tnl.h" #include "tnl/t_context.h" #include "tnl/t_pipeline.h" +#endif #include "drivers/common/driverfuncs.h" #include "state_tracker/st_public.h" @@ -1528,7 +1530,9 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) XMesaContext c; GLcontext *mesaCtx; struct dd_function_table functions; +#if 0 TNLcontext *tnl; +#endif if (firstTime) { _glthread_INIT_MUTEX(_xmesa_lock); @@ -1591,17 +1595,22 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) /* Initialize the software rasterizer and helper modules. */ if (!_swrast_CreateContext( mesaCtx ) || +#if 0 !_vbo_CreateContext( mesaCtx ) || !_tnl_CreateContext( mesaCtx ) || +#endif !_swsetup_CreateContext( mesaCtx )) { _mesa_free_context_data(&c->mesa); _mesa_free(c); return NULL; } +#if 0 /* tnl setup */ tnl = TNL_CONTEXT(mesaCtx); tnl->Driver.RunPipeline = _tnl_run_pipeline; +#endif + /* swrast setup */ xmesa_register_swrast_functions( mesaCtx ); _swsetup_Wakeup(mesaCtx); @@ -1641,8 +1650,10 @@ void XMesaDestroyContext( XMesaContext c ) _swsetup_DestroyContext( mesaCtx ); _swrast_DestroyContext( mesaCtx ); +#if 0 _tnl_DestroyContext( mesaCtx ); _vbo_DestroyContext( mesaCtx ); +#endif _mesa_free_context_data( mesaCtx ); _mesa_free( c ); } diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 95c5eec26e0..97e178bbe13 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -78,6 +78,11 @@ struct st_context *st_create_context( GLcontext *ctx, st->ctx = ctx; st->pipe = pipe; + /* state tracker needs the VBO module */ + _vbo_CreateContext(ctx); + /* XXX temporary */ + _tnl_CreateContext(ctx); + st->draw = draw_create(); /* for selection/feedback */ st->dirty.mesa = ~0; @@ -125,6 +130,9 @@ void st_destroy_context( struct st_context *st ) st_destroy_atoms( st ); st_destroy_draw( st ); + _vbo_DestroyContext(st->ctx); + _tnl_DestroyContext(st->ctx); /* XXX temporary */ + #if 0 st_destroy_cb_clear( st ); st_destroy_cb_program( st ); -- 2.30.2