Lift VBO/tnl stuff up out of drivers

This commit is contained in:
Brian
2007-10-31 11:35:50 -06:00
parent b31e37f14d
commit 8984a28338
3 changed files with 22 additions and 15 deletions

View File

@@ -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);
}
}

View File

@@ -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 );
}

View File

@@ -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 );