summaryrefslogtreecommitdiff
path: root/src/mesa/tnl/t_context.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2005-06-09 14:55:34 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2005-06-09 14:55:34 +0000
commit81032030ff42dd78133d85f7cabab5fb4c9aaf1e (patch)
treed91f33c2f2c3d0814b43ae0da17a4f120c4e4372 /src/mesa/tnl/t_context.c
parenta8534885efb13ec7f071192c1504513cd90d07de (diff)
Store compiled vertex program representations in a pointer in the
vertex_program struct. Allow switching between regular and vertex_program implementations of fixed function TNL with the MESA_TNL_PROG environment var (previously this required recompilation). Ensure program compilation only references program data, not the wider context. This means that compiled programs only need to be invalidated when the program string changes, not on other state changes.
Diffstat (limited to 'src/mesa/tnl/t_context.c')
-rw-r--r--src/mesa/tnl/t_context.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index 48119d2d58..a6a7cdc738 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -95,7 +95,11 @@ _tnl_CreateContext( GLcontext *ctx )
_tnl_save_init( ctx );
_tnl_array_init( ctx );
_tnl_vtx_init( ctx );
- _tnl_install_pipeline( ctx, _tnl_default_pipeline );
+
+ if (ctx->_MaintainTnlProgram)
+ _tnl_install_pipeline( ctx, _tnl_vp_pipeline );
+ else
+ _tnl_install_pipeline( ctx, _tnl_default_pipeline );
/* Initialize the arrayelt helper
*/
@@ -140,6 +144,8 @@ _tnl_DestroyContext( GLcontext *ctx )
_tnl_destroy_pipeline( ctx );
_ae_destroy_context( ctx );
+ _tnl_ProgramCacheDestroy( ctx );
+
FREE(tnl);
ctx->swtnl_context = NULL;
}