summaryrefslogtreecommitdiff
path: root/src/mesa/tnl/t_context.c
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2007-02-22 08:53:33 -0700
committerBrian <brian@yutani.localnet.net>2007-02-22 08:53:33 -0700
commit29c471aafc6a3fef23d553e31a555d1782854a77 (patch)
tree335385fd55d510118346136c6feb4daa707988b6 /src/mesa/tnl/t_context.c
parent6d4cf6be4e79c3a6ab18272577df17389e3834a6 (diff)
parenta4b344baa2484c65a1618f3cce3a94c91dea8ef7 (diff)
Merge branch 'origin' into glsl-compiler-1
Conflicts: src/mesa/main/state.c src/mesa/shader/program.c src/mesa/shader/program.h src/mesa/shader/programopt.c src/mesa/shader/slang/slang_execute.c src/mesa/sources src/mesa/swrast/s_arbshader.c src/mesa/swrast/s_context.c src/mesa/swrast/s_span.c src/mesa/swrast/s_zoom.c src/mesa/tnl/t_context.c src/mesa/tnl/t_save_api.c src/mesa/tnl/t_vb_arbprogram.c src/mesa/tnl/t_vp_build.c src/mesa/tnl/t_vtx_eval.c
Diffstat (limited to 'src/mesa/tnl/t_context.c')
-rw-r--r--src/mesa/tnl/t_context.c99
1 files changed, 7 insertions, 92 deletions
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index 3887f18213..3b2f91acba 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -26,38 +26,19 @@
*/
-#include "api_arrayelt.h"
#include "glheader.h"
#include "imports.h"
#include "context.h"
#include "macros.h"
#include "mtypes.h"
-#include "dlist.h"
#include "light.h"
-#include "vtxfmt.h"
#include "tnl.h"
-#include "t_array_api.h"
#include "t_context.h"
#include "t_pipeline.h"
-#include "t_save_api.h"
#include "t_vp_build.h"
-#include "t_vtx_api.h"
-
-
-
-static void
-install_driver_callbacks( GLcontext *ctx )
-{
- ctx->Driver.NewList = _tnl_NewList;
- ctx->Driver.EndList = _tnl_EndList;
- ctx->Driver.FlushVertices = _tnl_FlushVertices;
- ctx->Driver.SaveFlushVertices = _tnl_SaveFlushVertices;
- ctx->Driver.BeginCallList = _tnl_BeginCallList;
- ctx->Driver.EndCallList = _tnl_EndCallList;
-}
-
+#include "vbo/vbo.h"
GLboolean
_tnl_CreateContext( GLcontext *ctx )
@@ -72,20 +53,13 @@ _tnl_CreateContext( GLcontext *ctx )
return GL_FALSE;
}
- if (_mesa_getenv("MESA_CODEGEN"))
- tnl->AllowCodegen = GL_TRUE;
-
/* Initialize the VB.
*/
tnl->vb.Size = ctx->Const.MaxArrayLockSize + MAX_CLIPPED_VERTICES;
- /* Initialize tnl state and tnl->vtxfmt.
+ /* Initialize tnl state.
*/
- _tnl_save_init( ctx );
- _tnl_array_init( ctx );
- _tnl_vtx_init( ctx );
-
if (ctx->VertexProgram._MaintainTnlProgram) {
_tnl_ProgramCacheInit( ctx );
_tnl_install_pipeline( ctx, _tnl_vp_pipeline );
@@ -93,34 +67,18 @@ _tnl_CreateContext( GLcontext *ctx )
_tnl_install_pipeline( ctx, _tnl_default_pipeline );
}
- /* Initialize the arrayelt helper
- */
- if (!_ae_create_context( ctx ))
- return GL_FALSE;
-
-
tnl->NeedNdcCoords = GL_TRUE;
- tnl->LoopbackDListCassettes = GL_FALSE;
- tnl->CalcDListNormalLengths = GL_TRUE;
tnl->AllowVertexFog = GL_TRUE;
tnl->AllowPixelFog = GL_TRUE;
- /* Hook our functions into exec and compile dispatch tables.
- */
- _mesa_install_exec_vtxfmt( ctx, &tnl->exec_vtxfmt );
-
-
/* Set a few default values in the driver struct.
*/
- install_driver_callbacks(ctx);
- ctx->Driver.NeedFlush = 0;
- ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
- ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
-
tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
tnl->Driver.NotifyMaterialChange = _mesa_validate_all_lighting_tables;
+ tnl->nr_blocks = 0;
+
return GL_TRUE;
}
@@ -130,11 +88,7 @@ _tnl_DestroyContext( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- _tnl_array_destroy( ctx );
- _tnl_vtx_destroy( ctx );
- _tnl_save_destroy( ctx );
_tnl_destroy_pipeline( ctx );
- _ae_destroy_context( ctx );
if (ctx->VertexProgram._MaintainTnlProgram)
_tnl_ProgramCacheDestroy( ctx );
@@ -155,10 +109,7 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
|| !tnl->AllowPixelFog;
}
- _ae_invalidate_state(ctx, new_state);
-
tnl->pipeline.new_state |= new_state;
- tnl->vtx.eval.new_state |= new_state;
/* Calculate tnl->render_inputs:
*/
@@ -210,36 +161,21 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
void
-_tnl_wakeup_exec( GLcontext *ctx )
+_tnl_wakeup( GLcontext *ctx )
{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- install_driver_callbacks(ctx);
- ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT;
-
- /* Hook our functions into exec and compile dispatch tables.
- */
- _mesa_install_exec_vtxfmt( ctx, &tnl->exec_vtxfmt );
-
/* Assume we haven't been getting state updates either:
*/
_tnl_InvalidateState( ctx, ~0 );
+#if 0
if (ctx->Light.ColorMaterialEnabled) {
_mesa_update_color_material( ctx,
ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
}
+#endif
}
-void
-_tnl_wakeup_save_exec( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- _tnl_wakeup_exec( ctx );
- _mesa_install_save_vtxfmt( ctx, &tnl->save_vtxfmt );
-}
/**
@@ -255,27 +191,6 @@ _tnl_need_projected_coords( GLcontext *ctx, GLboolean mode )
}
void
-_tnl_need_dlist_loopback( GLcontext *ctx, GLboolean mode )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->LoopbackDListCassettes = mode;
-}
-
-void
-_tnl_need_dlist_norm_lengths( GLcontext *ctx, GLboolean mode )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->CalcDListNormalLengths = mode;
-}
-
-void
-_tnl_isolate_materials( GLcontext *ctx, GLboolean mode )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->IsolateMaterials = mode;
-}
-
-void
_tnl_allow_vertex_fog( GLcontext *ctx, GLboolean value )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);