summaryrefslogtreecommitdiff
path: root/src/mesa/tnl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_context.c173
-rw-r--r--src/mesa/tnl/t_context.h48
-rw-r--r--src/mesa/tnl/t_pipeline.c43
-rw-r--r--src/mesa/tnl/t_pipeline.h27
-rw-r--r--src/mesa/tnl/tnl.h14
5 files changed, 201 insertions, 104 deletions
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index 78608459b9..457aa1c85f 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -1,5 +1,6 @@
#include "mtypes.h"
#include "mem.h"
+#include "vtxfmt.h"
#include "t_context.h"
#include "t_clip.h"
@@ -15,10 +16,11 @@
#include "t_vb.h"
#include "t_vbrender.h"
#include "t_vbxform.h"
+#include "t_vtxfmt.h"
#include "tnl.h"
#if !defined(THREADS)
-struct immediate *_mesa_CurrentInput = NULL;
+struct immediate *_tnl_CurrentInput = NULL;
#endif
@@ -31,9 +33,9 @@ _tnl_flush_vertices( GLcontext *ctx, GLuint flush_flags )
if ((IM->Flag[IM->Count] & (VERT_BEGIN|VERT_END)) != VERT_END ||
(flush_flags & (FLUSH_STORED_VERTICES|FLUSH_UPDATE_CURRENT)))
{
- if (IM->Flag[IM->Start])
- _mesa_flush_vb( ctx );
-
+ if (IM->Flag[IM->Start])
+ _tnl_maybe_transform_vb( IM );
+
/* Although this code updates the ctx->Current values, that bit
* is left set as there is no easy mechanism to set it
* elsewhere. This means that each time core wants to examine
@@ -50,6 +52,53 @@ _tnl_flush_vertices( GLcontext *ctx, GLuint flush_flags )
}
+
+ void
+_tnl_MakeCurrent( GLcontext *ctx,
+ GLframebuffer *drawBuffer,
+ GLframebuffer *readBuffer )
+{
+#ifndef THREADS
+ SET_IMMEDIATE( ctx, TNL_VB(ctx)->IM );
+#endif
+}
+
+
+/* Update all state that references _NeedEyeCoords
+ */
+ void
+_tnl_LightingSpaceChange( GLcontext *ctx )
+{
+ _tnl_update_normal_transform( ctx );
+}
+
+
+static void
+install_driver_callbacks( GLcontext *ctx )
+{
+ ctx->Driver.RenderVBCulledTab = _tnl_render_tab_cull;
+ ctx->Driver.RenderVBClippedTab = _tnl_render_tab_clipped;
+ ctx->Driver.RenderVBRawTab = _tnl_render_tab_raw;
+ ctx->Driver.NewList = _tnl_NewList;
+ ctx->Driver.EndList = _tnl_EndList;
+ ctx->Driver.FlushVertices = _tnl_flush_vertices;
+ ctx->Driver.NeedFlush = FLUSH_UPDATE_CURRENT;
+ ctx->Driver.LightingSpaceChange = _tnl_LightingSpaceChange;
+ ctx->Driver.MakeCurrent = _tnl_MakeCurrent;
+ ctx->Driver.VertexPointer = _tnl_VertexPointer;
+ ctx->Driver.NormalPointer = _tnl_NormalPointer;
+ ctx->Driver.ColorPointer = _tnl_ColorPointer;
+ ctx->Driver.FogCoordPointer = _tnl_FogCoordPointer;
+ ctx->Driver.IndexPointer = _tnl_IndexPointer;
+ ctx->Driver.SecondaryColorPointer = _tnl_SecondaryColorPointer;
+ ctx->Driver.TexCoordPointer = _tnl_TexCoordPointer;
+ ctx->Driver.EdgeFlagPointer = _tnl_EdgeFlagPointer;
+ ctx->Driver.LockArraysEXT = _tnl_LockArraysEXT;
+ ctx->Driver.UnlockArraysEXT = _tnl_UnlockArraysEXT;
+}
+
+
+
GLboolean
_tnl_CreateContext( GLcontext *ctx )
{
@@ -61,13 +110,13 @@ _tnl_CreateContext( GLcontext *ctx )
*/
if (firsttime) {
firsttime = 0;
- _tnl_clip_init( );
- _tnl_eval_init( );
- _tnl_shade_init( );
- _tnl_texture_init( );
- _tnl_trans_elt_init( );
- _tnl_vbrender_init( );
- _tnl_stages_init( );
+ _tnl_clip_init();
+ _tnl_eval_init();
+ _tnl_shade_init();
+ _tnl_texture_init();
+ _tnl_trans_elt_init();
+ _tnl_vbrender_init();
+ _tnl_stages_init();
}
/* Create the TNLcontext structure
@@ -79,7 +128,7 @@ _tnl_CreateContext( GLcontext *ctx )
/* Create and hook in the data structures available from ctx.
*/
- ctx->swtnl_vb = (void *)gl_vb_create_for_immediate( ctx );
+ ctx->swtnl_vb = (void *)_tnl_vb_create_for_immediate( ctx );
if (!ctx->swtnl_vb) {
FREE(tnl);
ctx->swtnl_context = 0;
@@ -93,6 +142,12 @@ _tnl_CreateContext( GLcontext *ctx )
*/
_tnl_dlist_init( ctx );
_tnl_pipeline_init( ctx );
+ _tnl_vtxfmt_init( ctx );
+ _tnl_cva_init( ctx );
+
+ _tnl_reset_vb( TNL_VB(ctx) );
+ _tnl_reset_input( ctx, 0, 0 ); /* initially outside begin/end */
+
tnl->_CurrentFlag = (VERT_NORM |
VERT_INDEX |
@@ -108,30 +163,14 @@ _tnl_CreateContext( GLcontext *ctx )
tnl->_CurrentPrimitive = GL_POLYGON+1;
- gl_reset_vb( TNL_VB(ctx) );
- gl_reset_input( ctx );
-
+ /* Hook our functions into exec and compile dispatch tables.
+ */
+ _mesa_install_save_vtxfmt( ctx, &tnl->vtxfmt );
+ _mesa_install_exec_vtxfmt( ctx, &tnl->vtxfmt );
- /* Set a few default values in the driver struct. This is a
- * temporary mechanism.
+ /* Set a few default values in the driver struct.
*/
- ctx->Driver.RenderVBCulledTab = _tnl_render_tab_cull;
- ctx->Driver.RenderVBClippedTab = _tnl_render_tab_clipped;
- ctx->Driver.RenderVBRawTab = _tnl_render_tab_raw;
- ctx->Driver.NewList = _tnl_NewList;
- ctx->Driver.EndList = _tnl_EndList;
- ctx->Driver.FlushVertices = _tnl_flush_vertices;
- ctx->Driver.NeedFlush = FLUSH_UPDATE_CURRENT;
- ctx->Driver.LightingSpaceChange = _tnl_LightingSpaceChange;
- ctx->Driver.MakeCurrent = _tnl_MakeCurrent;
- ctx->Driver.VertexPointer = _tnl_VertexPointer;
- ctx->Driver.NormalPointer = _tnl_NormalPointer;
- ctx->Driver.ColorPointer = _tnl_ColorPointer;
- ctx->Driver.FogCoordPointer = _tnl_FogCoordPointer;
- ctx->Driver.IndexPointer = _tnl_IndexPointer;
- ctx->Driver.SecondaryColorPointer = _tnl_SecondaryColorPointer;
- ctx->Driver.TexCoordPointer = _tnl_TexCoordPointer;
- ctx->Driver.EdgeFlagPointer = _tnl_EdgeFlagPointer;
+ install_driver_callbacks(ctx);
return GL_TRUE;
}
@@ -143,9 +182,9 @@ _tnl_DestroyContext( GLcontext *ctx )
TNLcontext *tnl = TNL_CONTEXT(ctx);
if (TNL_CURRENT_IM(ctx) != TNL_VB(ctx)->IM)
- gl_immediate_free( TNL_CURRENT_IM(ctx) );
+ _tnl_immediate_free( TNL_CURRENT_IM(ctx) );
- gl_vb_free( TNL_VB(ctx) );
+ _tnl_vb_free( TNL_VB(ctx) );
/* Free cache of immediate buffers. */
while (tnl->nr_im_queued-- > 0) {
@@ -156,23 +195,15 @@ _tnl_DestroyContext( GLcontext *ctx )
}
-/* Update all state that references _NeedEyeCoords
- */
-void
-_tnl_LightingSpaceChange( GLcontext *ctx )
-{
- _tnl_update_normal_transform( ctx );
-}
-
void
_tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
{
if (new_state & _NEW_LIGHT)
- gl_update_lighting_function(ctx);
+ _tnl_update_lighting_function(ctx);
if (new_state & _NEW_ARRAY)
- gl_update_client_state( ctx );
+ _tnl_update_client_state( ctx );
if (new_state & _NEW_TEXTURE)
if (ctx->_Enabled & ENABLE_TEXGEN_ANY)
@@ -182,20 +213,54 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
_DD_NEW_TRI_LIGHT_TWOSIDE |
_DD_NEW_SEPERATE_SPECULAR |
_DD_NEW_TRI_UNFILLED ))
- gl_update_clipmask(ctx);
+ _tnl_update_clipmask(ctx);
if (new_state & _TNL_NEW_NORMAL_TRANSFORM)
_tnl_update_normal_transform( ctx );
- gl_update_pipelines(ctx);
+ _tnl_update_pipelines(ctx);
}
void
-_tnl_MakeCurrent( GLcontext *ctx,
- GLframebuffer *drawBuffer,
- GLframebuffer *readBuffer )
+_tnl_wakeup_exec( GLcontext *ctx )
{
-#ifndef THREADS
- SET_IMMEDIATE( ctx, TNL_VB(ctx)->IM );
-#endif
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ install_driver_callbacks(ctx);
+
+ /* Hook our functions into exec and compile dispatch tables.
+ */
+ _mesa_install_exec_vtxfmt( ctx, &tnl->vtxfmt );
+
+ /* Call all appropriate driver callbacks to revive state.
+ */
+ _tnl_MakeCurrent( ctx, ctx->DrawBuffer, ctx->ReadBuffer );
+ _tnl_UnlockArraysEXT( ctx );
+ _tnl_LockArraysEXT( ctx, ctx->Array.LockFirst, ctx->Array.LockCount );
+
+ /* Equivalent to calling all _tnl_*Pointer functions:
+ */
+ tnl->_ArrayNewState = ~0;
+
+ /* Assume we haven't been getting state updates either:
+ */
+ _tnl_InvalidateState( ctx, ~0 );
+
+ /* Special state not restored by other methods:
+ */
+ _tnl_recalc_current_flag( ctx );
}
+
+void
+_tnl_wakeup_save_exec( GLcontext *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ _tnl_wakeup_exec( ctx );
+ _mesa_install_save_vtxfmt( ctx, &tnl->vtxfmt );
+}
+
diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h
index 484b6b12df..5f6de86aac 100644
--- a/src/mesa/tnl/t_context.h
+++ b/src/mesa/tnl/t_context.h
@@ -1,5 +1,5 @@
-/* $Id: t_context.h,v 1.3 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: t_context.h,v 1.4 2000/11/24 10:25:12 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -142,6 +142,9 @@
#define VERT_TEX3_1234 (VERT_TEX3_4|VERT_TEX3_123)
#define VERT_TEX3_ANY VERT_TEX3_12
+#define VERT_TEX_ANY_ANY (VERT_TEX0_ANY|VERT_TEX1_ANY| \
+ VERT_TEX2_ANY|VERT_TEX3_ANY)
+
#define NR_TEXSIZE_BITS 3
#define VERT_TEX_ANY(i) (VERT_TEX0_ANY << ((i) * NR_TEXSIZE_BITS))
@@ -173,12 +176,6 @@
VERT_FOG_COORD)
-/* For beginstate
- */
-#define VERT_BEGIN_0 0x1 /* glBegin (if initially inside beg/end) */
-#define VERT_BEGIN_1 0x2 /* glBegin (if initially outside beg/end) */
-#define VERT_ERROR_0 0x4 /* invalid_operation in initial state 0 */
-#define VERT_ERROR_1 0x8 /* invalid_operation in initial state 1 */
struct gl_pipeline;
@@ -240,7 +237,6 @@ enum {
#define VERT_ERROR_0 0x4 /* invalid_operation in initial state 0 */
#define VERT_ERROR_1 0x8 /* invalid_operation in initial state 1 */
-
/* KW: Represents everything that can take place between a begin and
* end, and can represent multiple begin/end pairs. This plus *any*
* state variable (GLcontext) should be all you need to replay the
@@ -259,7 +255,8 @@ struct immediate
*/
GLuint Start, Count;
GLuint LastData; /* count or count+1 */
- GLuint AndFlag, OrFlag, BeginState;
+ GLuint AndFlag, OrFlag;
+ GLuint BeginState, SavedBeginState;
GLuint LastPrimitive;
GLuint ArrayAndFlags; /* precalc'ed for glArrayElt */
@@ -437,7 +434,7 @@ typedef struct vertex_buffer
} TNLvertexbuffer;
-typedef void (*gl_shade_func)( struct vertex_buffer *VB );
+typedef void (*shade_func)( struct vertex_buffer *VB );
typedef void (*clip_interp_func)( struct vertex_buffer *VB, GLuint dst,
GLfloat t, GLuint in, GLuint out );
@@ -531,12 +528,26 @@ struct gl_cva {
GLuint orflag;
GLuint merge;
+ GLuint locked;
GLuint lock_changed;
GLuint last_orflag;
GLuint last_array_flags;
GLuint last_array_new_state;
};
+/* These are used to make the ctx->Current values look like
+ * arrays (with zero StrideB).
+ */
+struct gl_fallback_arrays {
+ struct gl_client_array Normal;
+ struct gl_client_array Color;
+ struct gl_client_array SecondaryColor;
+ struct gl_client_array FogCoord;
+ struct gl_client_array Index;
+ struct gl_client_array TexCoord[MAX_TEXTURE_UNITS];
+ struct gl_client_array EdgeFlag;
+};
+
typedef void (*texgen_func)( struct vertex_buffer *VB,
@@ -577,18 +588,24 @@ typedef struct tnl_context {
clip_poly_func *_poly_clip_tab;
clip_line_func *_line_clip_tab;
clip_interp_func _ClipInterpFunc; /* Clip interpolation function */
- normal_func *_NormalTransform;
- gl_shade_func *_shade_func_tab; /* Current shading function table */
+ normal_func *_NormalTransform;
+ shade_func *_shade_func_tab; /* Current shading function table */
GLenum _CurrentPrimitive; /* Prim or GL_POLYGON+1 */
GLuint _CurrentFlag;
+ GLboolean _ReplayHardBeginEnd; /* Display list execution of rect, etc */
+
GLuint _RenderFlags; /* Active inputs to render stage */
/* Cache of unused immediate structs */
struct immediate *freed_im_queue;
GLuint nr_im_queued;
+ struct gl_fallback_arrays Fallback;
+
+ GLvertexformat vtxfmt;
+
} TNLcontext;
@@ -597,7 +614,6 @@ typedef struct tnl_context {
#define TNL_CURRENT_IM(ctx) ((struct immediate *)(ctx->swtnl_im))
#define TNL_VB(ctx) ((struct vertex_buffer *)(ctx->swtnl_vb))
-extern void _tnl_reset_immediate( GLcontext *ctx );
extern GLboolean _tnl_flush_vertices( GLcontext *ctx, GLuint flush_flags );
@@ -617,12 +633,12 @@ _tnl_LightingSpaceChange( GLcontext *ctx );
#define GET_IMMEDIATE struct immediate *IM = TNL_CURRENT_IM(((GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context())))
#define SET_IMMEDIATE(ctx, im) ctx->swtnl_im = (void *)im
#else
-extern struct immediate *_mesa_CurrentInput;
-#define GET_IMMEDIATE struct immediate *IM = _mesa_CurrentInput
+extern struct immediate *_tnl_CurrentInput;
+#define GET_IMMEDIATE struct immediate *IM = _tnl_CurrentInput
#define SET_IMMEDIATE(ctx, im) \
do { \
ctx->swtnl_im = (void *)im; \
- _mesa_CurrentInput = im; \
+ _tnl_CurrentInput = im; \
} while (0)
#endif
diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c
index d61f63f9b3..42b9d05155 100644
--- a/src/mesa/tnl/t_pipeline.c
+++ b/src/mesa/tnl/t_pipeline.c
@@ -1,4 +1,4 @@
-/* $Id: t_pipeline.c,v 1.3 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: t_pipeline.c,v 1.4 2000/11/24 10:25:12 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -41,6 +41,7 @@
#include "t_bbox.h"
#include "t_clip.h"
#include "t_cva.h"
+#include "t_debug.h"
#include "t_fog.h"
#include "t_light.h"
#include "t_pipeline.h"
@@ -55,7 +56,7 @@
-void gl_print_pipe_ops( const char *msg, GLuint flags )
+void _tnl_print_pipe_ops( const char *msg, GLuint flags )
{
fprintf(stderr,
"%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s\n",
@@ -80,13 +81,13 @@ void gl_print_pipe_ops( const char *msg, GLuint flags )
/* Have to reset only those parts of the vb which are being recalculated.
*/
-void gl_reset_cva_vb( struct vertex_buffer *VB, GLuint stages )
+void _tnl_reset_cva_vb( struct vertex_buffer *VB, GLuint stages )
{
GLcontext *ctx = VB->ctx;
TNLcontext *tnl = TNL_CONTEXT(ctx);
if (MESA_VERBOSE&VERBOSE_PIPELINE)
- gl_print_pipe_ops( "reset cva vb", stages );
+ _tnl_print_pipe_ops( "reset cva vb", stages );
if (stages & PIPE_OP_VERT_XFORM)
{
@@ -142,8 +143,8 @@ static void pipeline_ctr( struct gl_pipeline *p, GLcontext *ctx, GLuint type )
p->type = type;
p->ops = 0;
- for (i = 0 ; i < gl_default_nr_stages ; i++)
- p->state_change |= gl_default_pipeline[i].state_change;
+ for (i = 0 ; i < _tnl_default_nr_stages ; i++)
+ p->state_change |= _tnl_default_pipeline[i].state_change;
}
@@ -151,12 +152,12 @@ void _tnl_pipeline_init( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- MEMCPY( tnl->PipelineStage,
- gl_default_pipeline,
- sizeof(*gl_default_pipeline) * gl_default_nr_stages );
-
- tnl->NrPipelineStages = gl_default_nr_stages;
-
+ MEMCPY( tnl->PipelineStage,
+ _tnl_default_pipeline,
+ sizeof(*_tnl_default_pipeline) * _tnl_default_nr_stages );
+
+ tnl->NrPipelineStages = _tnl_default_nr_stages;
+
pipeline_ctr( &tnl->CVA.elt, ctx, PIPE_IMMEDIATE);
pipeline_ctr( &tnl->CVA.pre, ctx, PIPE_PRECALC );
}
@@ -224,7 +225,7 @@ static void build_full_precalc_pipeline( GLcontext *ctx )
if (MESA_VERBOSE & VERBOSE_PIPELINE) {
fprintf(stderr, ": Rebuild pipeline\n");
- gl_print_vert_flags("orflag", cva->orflag);
+ _tnl_print_vert_flags("orflag", cva->orflag);
}
@@ -290,7 +291,7 @@ static void build_full_precalc_pipeline( GLcontext *ctx )
pre->changed_ops = changed_ops;
}
-void gl_build_precalc_pipeline( GLcontext *ctx )
+void _tnl_build_precalc_pipeline( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct gl_pipeline *pre = &tnl->CVA.pre;
@@ -307,7 +308,7 @@ void gl_build_precalc_pipeline( GLcontext *ctx )
tnl->CVA.orflag = 0;
if (MESA_VERBOSE&VERBOSE_PIPELINE)
- gl_print_pipeline( ctx, pre );
+ _tnl_print_pipeline( ctx, pre );
}
@@ -378,7 +379,7 @@ static void build_full_immediate_pipeline( GLcontext *ctx )
-void gl_build_immediate_pipeline( GLcontext *ctx )
+void _tnl_build_immediate_pipeline( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct gl_pipeline *elt = &tnl->CVA.elt;
@@ -392,12 +393,12 @@ void gl_build_immediate_pipeline( GLcontext *ctx )
tnl->CVA.orflag = 0;
if (MESA_VERBOSE&VERBOSE_PIPELINE)
- gl_print_pipeline( ctx, elt );
+ _tnl_print_pipeline( ctx, elt );
}
#define INTERESTED ~0
-void gl_update_pipelines( GLcontext *ctx )
+void _tnl_update_pipelines( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint newstate = ctx->NewState;
@@ -476,7 +477,7 @@ void gl_update_pipelines( GLcontext *ctx )
cva->last_array_flags = tnl->_ArrayFlags;
}
-void gl_run_pipeline( struct vertex_buffer *VB )
+void _tnl_run_pipeline( struct vertex_buffer *VB )
{
struct gl_pipeline *pipe = VB->pipeline;
struct gl_pipeline_stage **stages = pipe->stages;
@@ -484,8 +485,8 @@ void gl_run_pipeline( struct vertex_buffer *VB )
pipe->data_valid = 1; /* optimized stages might want to reset this. */
- if (0) gl_print_pipeline( VB->ctx, pipe );
-
+ if (0) _tnl_print_pipeline( VB->ctx, pipe );
+
START_FAST_MATH(x);
for ( VB->Culled = 0; *stages && !VB->Culled ; stages++ )
diff --git a/src/mesa/tnl/t_pipeline.h b/src/mesa/tnl/t_pipeline.h
index 5609b79af9..b9ae641894 100644
--- a/src/mesa/tnl/t_pipeline.h
+++ b/src/mesa/tnl/t_pipeline.h
@@ -1,4 +1,4 @@
-/* $Id: t_pipeline.h,v 1.2 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: t_pipeline.h,v 1.3 2000/11/24 10:25:12 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -36,24 +36,25 @@
#include "mtypes.h"
#include "t_context.h"
-extern void gl_update_materials( struct vertex_buffer *VB);
-
extern void _tnl_pipeline_init( GLcontext *ctx );
-extern void gl_update_pipelines( GLcontext *ctx );
-extern void gl_build_precalc_pipeline( GLcontext *ctx );
-extern void gl_build_immediate_pipeline( GLcontext *ctx );
+extern void _tnl_update_materials( struct vertex_buffer *VB);
+
+extern void _tnl_update_pipelines( GLcontext *ctx );
+
+extern void _tnl_build_precalc_pipeline( GLcontext *ctx );
+extern void _tnl_build_immediate_pipeline( GLcontext *ctx );
-extern void gl_print_vert_flags( const char *name, GLuint flags );
-extern void gl_print_pipeline( GLcontext *ctx, struct gl_pipeline *p );
-extern void gl_print_active_pipeline( GLcontext *ctx, struct gl_pipeline *p );
+extern void _tnl_print_vert_flags( const char *name, GLuint flags );
+extern void _tnl_print_pipeline( GLcontext *ctx, struct gl_pipeline *p );
+extern void _tnl_print_active_pipeline( GLcontext *ctx, struct gl_pipeline *p );
-extern void gl_run_pipeline( struct vertex_buffer *VB );
+extern void _tnl_run_pipeline( struct vertex_buffer *VB );
-extern void gl_clean_color( struct vertex_buffer *VB );
+extern void _tnl_clean_color( struct vertex_buffer *VB );
-extern void gl_reset_cva_vb( struct vertex_buffer *VB, GLuint stages );
+extern void _tnl_reset_cva_vb( struct vertex_buffer *VB, GLuint stages );
-extern void gl_print_pipe_ops( const char *msg, GLuint flags );
+extern void _tnl_print_pipe_ops( const char *msg, GLuint flags );
#endif
diff --git a/src/mesa/tnl/tnl.h b/src/mesa/tnl/tnl.h
index c820776590..c14ed296ad 100644
--- a/src/mesa/tnl/tnl.h
+++ b/src/mesa/tnl/tnl.h
@@ -44,5 +44,19 @@ _tnl_DestroyContext( GLcontext *ctx );
extern void
_tnl_InvalidateState( GLcontext *ctx, GLuint new_state );
+/* Functions to revive the tnl module after being unhooked from
+ * dispatch and/or driver callbacks.
+ */
+
+/* Restore just the ctx->Exec table:
+ */
+extern void
+_tnl_wakeup_exec( GLcontext *ctx );
+
+/* Restore both ctx->Exec and ctx->Save:
+ */
+extern void
+_tnl_wakeup_save_exec( GLcontext *ctx );
+
#endif