-/* $Id: t_pipeline.c,v 1.14 2001/03/12 00:48:43 gareth Exp $ */
+/* $Id: t_pipeline.c,v 1.24 2002/10/24 23:57:25 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "state.h"
#include "mtypes.h"
pipe->build_state_trigger |= pipe->stages[i].check_state;
}
+ MEMSET( &pipe->stages[i], 0, sizeof( **stages ));
+
pipe->nr_stages = i;
}
struct gl_pipeline_stage *s = pipe->stages;
GLuint newstate = pipe->build_state_changes;
GLuint generated = 0;
- GLuint i;
GLuint changed_inputs = 0;
pipe->inputs = 0;
pipe->build_state_changes = 0;
- for (i = pipe->nr_stages+1 ; --i ; s++) {
+ for ( ; s->check ; s++) {
s->changed_inputs |= s->inputs & changed_inputs;
void _tnl_run_pipeline( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &tnl->vb;
struct gl_pipeline *pipe = &tnl->pipeline;
struct gl_pipeline_stage *s = pipe->stages;
GLuint changed_state = pipe->run_state_changes;
GLuint changed_inputs = pipe->run_input_changes;
GLboolean running = GL_TRUE;
- GLuint i;
unsigned short __tmp;
+ pipe->run_state_changes = 0;
+ pipe->run_input_changes = 0;
+
/* Done elsewhere.
*/
ASSERT(pipe->build_state_changes == 0);
START_FAST_MATH(__tmp);
- if (ctx->Driver.PipelineStart)
- ctx->Driver.PipelineStart( ctx );
/* If something changes in the pipeline, tag all subsequent stages
- * using this value for recalculation.
- *
- * Even inactive stages have their state and inputs examined to try
- * to keep cached data alive over state-changes.
+ * using this value for recalculation. Inactive stages have their
+ * state and inputs examined to try to keep cached data alive over
+ * state-changes.
*/
- for (i = pipe->nr_stages+1 ; --i ; s++) {
+ for ( ; s->run ; s++) {
s->changed_inputs |= s->inputs & changed_inputs;
- if (s->run_state & changed_state) {
-/* changed_inputs |= s->check(ctx, s); */
+ if (s->run_state & changed_state)
s->changed_inputs = s->inputs;
- }
- if (s->active) {
- if (running) {
- if (s->changed_inputs)
- changed_inputs |= s->outputs;
+ if (s->active && running) {
+ if (s->changed_inputs)
+ changed_inputs |= s->outputs;
-/* fprintf(stderr, "run %s\n", s->name); */
- running = s->run( ctx, s );
- }
+ running = s->run( ctx, s );
+
+ s->changed_inputs = 0;
+ VB->importable_data &= ~s->outputs;
}
}
- if (ctx->Driver.PipelineFinish)
- ctx->Driver.PipelineFinish( ctx );
END_FAST_MATH(__tmp);
-
- pipe->run_state_changes = 0;
- pipe->run_input_changes = 0;
}
*
* - inserting optimized (but specialized) stages ahead of the
* general-purpose fallback implementation. For example, the old
- * fastpath mechanism, which only works when the VERT_ELT input is
+ * fastpath mechanism, which only works when the VERT_BIT_ELT input is
* available, can be duplicated by placing the fastpath stage at the
* head of this pipeline. Such specialized stages are currently
* constrained to have no outputs (ie. they must either finish the *
&_tnl_texgen_stage,
&_tnl_texture_transform_stage,
&_tnl_point_attenuation_stage,
+#if FEATURE_NV_vertex_program
+ &_tnl_vertex_program_stage,
+#endif
&_tnl_render_stage,
0
};