- GLuint newstate = pre->new_state;
- GLuint changed_ops = 0;
- GLuint oldoutputs = pre->outputs;
- GLuint oldinputs = pre->inputs;
- GLuint fallback = (VERT_CURRENT_DATA &
- ~tnl->_ArraySummary);
- GLuint changed_outputs = (tnl->_ArrayNewState |
- (fallback & cva->orflag));
- GLuint available = fallback | tnl->_ArrayFlags;
-
- pre->cva_state_change = 0;
- pre->ops = 0;
- pre->outputs = 0;
- pre->inputs = 0;
- pre->forbidden_inputs = 0;
- pre->fallback = 0;
-
- /* KW: Disable data reuse during Mesa reorg. Make this more readable...
- */
- newstate = ~0;
-
- if (tnl->_ArraySummary & VERT_ELT)
- cva->orflag &= VERT_MATERIAL;
-
- cva->orflag &= ~(tnl->_ArraySummary & ~VERT_OBJ_ANY);
- available &= ~cva->orflag;
-
- pre->outputs = available;
- pre->inputs = available;
-
- if (MESA_VERBOSE & VERBOSE_PIPELINE) {
- fprintf(stderr, ": Rebuild pipeline\n");
- _tnl_print_vert_flags("orflag", cva->orflag);
- }
-
-
-
- /* If something changes in the pipeline, tag all subsequent stages
- * using this value for recalcuation. Also used to build the full
- * pipeline by setting newstate and newinputs to ~0.
- *
- * Because all intermediate values are buffered, the new inputs
- * are enough to fully specify what needs to be calculated, and a
- * single pass identifies all stages requiring recalculation.
- */
- for (i = 0 ; i < tnl->NrPipelineStages ; i++)
- {
- pipeline[i].check(ctx, &pipeline[i]);
-
- if (pipeline[i].type & PIPE_PRECALC)
- {
- if ((newstate & pipeline[i].cva_state_change) ||
- (changed_outputs & pipeline[i].inputs) ||
- !pipeline[i].inputs)
- {
- changed_ops |= pipeline[i].ops;
- changed_outputs |= pipeline[i].outputs;
- pipeline[i].active &= ~PIPE_PRECALC;
-
- if ((pipeline[i].inputs & ~available) == 0 &&
- (pipeline[i].ops & pre->ops) == 0)
- {
- pipeline[i].active |= PIPE_PRECALC;
- *stages++ = &pipeline[i];
- }
- }
-
- /* Incompatible with multiple stages structs implementing
- * the same stage.
- */
- available &= ~pipeline[i].outputs;
- pre->outputs &= ~pipeline[i].outputs;