diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2005-06-09 14:55:34 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2005-06-09 14:55:34 +0000 |
commit | 81032030ff42dd78133d85f7cabab5fb4c9aaf1e (patch) | |
tree | d91f33c2f2c3d0814b43ae0da17a4f120c4e4372 /src/mesa/tnl/t_pipeline.c | |
parent | a8534885efb13ec7f071192c1504513cd90d07de (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_pipeline.c')
-rw-r--r-- | src/mesa/tnl/t_pipeline.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c index 6b0ea815e2..61bfed290e 100644 --- a/src/mesa/tnl/t_pipeline.c +++ b/src/mesa/tnl/t_pipeline.c @@ -131,9 +131,8 @@ void _tnl_run_pipeline( GLcontext *ctx ) * (ie const or non-const). */ if (check_input_changes( ctx ) || tnl->pipeline.new_state) { -#if TNL_FIXED_FUNCTION_PROGRAM - _tnl_UpdateFixedFunctionProgram( ctx ); -#endif + if (ctx->_MaintainTnlProgram) + _tnl_UpdateFixedFunctionProgram( ctx ); for (i = 0; i < tnl->pipeline.nr_stages ; i++) { struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i]; @@ -197,9 +196,6 @@ void _tnl_run_pipeline( GLcontext *ctx ) * case, if it becomes necessary to do so. */ const struct tnl_pipeline_stage *_tnl_default_pipeline[] = { -#if TNL_FIXED_FUNCTION_PROGRAM - &_tnl_arb_vertex_program_stage, -#else &_tnl_vertex_transform_stage, &_tnl_normal_transform_stage, &_tnl_lighting_stage, @@ -208,9 +204,15 @@ const struct tnl_pipeline_stage *_tnl_default_pipeline[] = { &_tnl_texture_transform_stage, &_tnl_point_attenuation_stage, #if defined(FEATURE_NV_vertex_program) || defined(FEATURE_ARB_vertex_program) - &_tnl_vertex_program_stage, -#endif + &_tnl_arb_vertex_program_stage, + &_tnl_vertex_program_stage, #endif &_tnl_render_stage, NULL }; + +const struct tnl_pipeline_stage *_tnl_vp_pipeline[] = { + &_tnl_arb_vertex_program_stage, + &_tnl_render_stage, + NULL +}; |