_tnl_run_pipeline() a little.
-/* $Id: t_array_api.c,v 1.12 2001/04/28 08:39:18 keithw Exp $ */
+/* $Id: t_array_api.c,v 1.13 2001/05/10 12:18:38 keithw Exp $ */
/*
* Mesa 3-D graphics library
tnl->vb.Elts = (GLuint *)indices;
if (ctx->Array.LockCount)
- _tnl_run_pipeline( ctx );
+ tnl->Driver.RunPipeline( ctx );
else {
/* Note that arrays may have changed before/after execution.
*/
tnl->pipeline.run_input_changes |= ctx->Array._Enabled;
- _tnl_run_pipeline( ctx );
+ tnl->Driver.RunPipeline( ctx );
tnl->pipeline.run_input_changes |= ctx->Array._Enabled;
}
}
VB->FirstPrimitive = start;
VB->Primitive[start] = mode | PRIM_BEGIN | PRIM_END | PRIM_LAST;
VB->PrimitiveLength[start] = count - start;
- _tnl_run_pipeline( ctx );
+ tnl->Driver.RunPipeline( ctx );
} else {
/* The arrays are small enough to fit in a single VB; just bind
* them and go. Any untransformed data will be copied on
* clipping.
*
- * Invalidate any locked data dependent on these arrays.
+ * Invalidate any cached data dependent on these arrays.
*/
_tnl_vb_bind_arrays( ctx, start, count );
VB->FirstPrimitive = 0;
VB->Primitive[0] = mode | PRIM_BEGIN | PRIM_END | PRIM_LAST;
VB->PrimitiveLength[0] = count - start;
tnl->pipeline.run_input_changes |= ctx->Array._Enabled;
- _tnl_run_pipeline( ctx );
+ tnl->Driver.RunPipeline( ctx );
tnl->pipeline.run_input_changes |= ctx->Array._Enabled;
}
}
VB->Primitive[0] = mode | PRIM_BEGIN | PRIM_END | PRIM_LAST;
VB->PrimitiveLength[0] = nr + minimum;
tnl->pipeline.run_input_changes |= ctx->Array._Enabled;
- _tnl_run_pipeline( ctx );
+ tnl->Driver.RunPipeline( ctx );
tnl->pipeline.run_input_changes |= ctx->Array._Enabled;
}
}
*/
_mesa_vector4f_init( &tmp->Obj, 0, 0 );
_mesa_vector3f_init( &tmp->Normal, 0, 0 );
-/* _mesa_vector4chan_init( &tmp->Color, 0, 0 ); */
-/* _mesa_vector4chan_init( &tmp->SecondaryColor, 0, 0 ); */
_mesa_vector1f_init( &tmp->FogCoord, 0, 0 );
_mesa_vector1ui_init( &tmp->Index, 0, 0 );
_mesa_vector1ub_init( &tmp->EdgeFlag, 0, 0 );
-/* $Id: t_context.h,v 1.22 2001/04/30 21:08:52 keithw Exp $ */
+/* $Id: t_context.h,v 1.23 2001/05/10 12:18:38 keithw Exp $ */
/*
* Mesa 3-D graphics library
GLuint run_state_changes; /* state changes since last run */
GLuint run_input_changes; /* VERT_* changes since last run */
GLuint inputs; /* VERT_* inputs to pipeline */
- struct gl_pipeline_stage stages[MAX_PIPELINE_STAGES];
+ struct gl_pipeline_stage stages[MAX_PIPELINE_STAGES+1];
GLuint nr_stages;
};
*** TNL Pipeline
***/
- void (*PipelineStart)(GLcontext *ctx);
- void (*PipelineFinish)(GLcontext *ctx);
- /* Called before and after all pipeline stages.
- * These are a suitable place for grabbing/releasing hardware locks.
+ void (*RunPipeline)(GLcontext *ctx);
+ /* Replaces PipelineStart/PipelineFinish -- intended to allow
+ * drivers to wrap _tnl_run_pipeline() with code to validate state
+ * and grab/release hardware locks.
*/
/***
-/* $Id: t_imm_exec.c,v 1.22 2001/05/09 13:53:36 keithw Exp $ */
+/* $Id: t_imm_exec.c,v 1.23 2001/05/10 12:18:38 keithw Exp $ */
/*
* Mesa 3-D graphics library
/* Invalidate all stored data before and after run:
*/
tnl->pipeline.run_input_changes |= tnl->pipeline.inputs;
- _tnl_run_pipeline( ctx );
+ tnl->Driver.RunPipeline( ctx );
tnl->pipeline.run_input_changes |= tnl->pipeline.inputs;
_tnl_copy_to_current( ctx, IM, IM->OrFlag );
/* Run the pipeline. No input changes as a result of this action.
*/
- _tnl_run_pipeline( ctx );
+ tnl->Driver.RunPipeline( ctx );
/* Still need to update current values: (TODO - copy from VB)
* TODO: delay this until FlushVertices
-/* $Id: t_pipeline.c,v 1.17 2001/04/30 09:04:00 keithw Exp $ */
+/* $Id: t_pipeline.c,v 1.18 2001/05/10 12:18:38 keithw Exp $ */
/*
* Mesa 3-D graphics library
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;
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);
-
-/* _tnl_print_vert_flags( "run_pipeline, new inputs", changed_inputs ); */
-/* _mesa_print_state( "run_pipeline, new state", changed_state ); */
START_FAST_MATH(__tmp);
- if (tnl->Driver.PipelineStart)
- tnl->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) {
+ 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;
- if (0)
- fprintf(stderr, "run %s inputs %x\n",
- s->name, s->changed_inputs);
+ running = s->run( ctx, s );
- running = s->run( ctx, s );
- s->changed_inputs = 0; /* readded this apr 30 */
- VB->importable_data &= ~s->outputs;
- }
+ s->changed_inputs = 0;
+ VB->importable_data &= ~s->outputs;
}
}
- if (tnl->Driver.PipelineFinish)
- tnl->Driver.PipelineFinish( ctx );
END_FAST_MATH(__tmp);
-
- pipe->run_state_changes = 0;
- pipe->run_input_changes = 0;
}