-/* $Id: t_dd_vb.c,v 1.14 2001/05/09 15:34:08 keithw Exp $ */
+/* $Id: t_dd_vb.c,v 1.15 2001/05/14 09:00:52 keithw Exp $ */
/*
* Mesa 3-D graphics library
GLuint dst, GLuint src )
{
LOCALVARS
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
if (VB->ColorPtr[1]) {
- COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst),
- GET_COLOR(VB->ColorPtr[1], src) );
+ COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst),
+ GET_COLOR(VB->ColorPtr[1], src) );
- if (VB->SecondaryColorPtr[1]) {
- COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst),
- GET_COLOR(VB->SecondaryColorPtr[1], src) );
- }
+ if (VB->SecondaryColorPtr[1]) {
+ COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst),
+ GET_COLOR(VB->SecondaryColorPtr[1], src) );
+ }
}
COPY_PV_VERTEX(ctx, dst, src);
-/* $Id: t_eval_api.c,v 1.6 2001/05/01 13:18:03 keithw Exp $ */
+/* $Id: t_eval_api.c,v 1.7 2001/05/14 09:00:51 keithw Exp $ */
/*
* Mesa 3-D graphics library
*
* TODO: Anaylse display lists to determine if this state is
* constant.
+ *
+ * State to watch:
+ * - enabled maps
+ * - map state for each enabled map, including control points
+ * - grid state
+ *
+ * Could alternatively cache individual maps in arrays, rather than
+ * building immediates.
*/
{
GLboolean compiling = ctx->CompileFlag;
-/* $Id: t_imm_dlist.c,v 1.18 2001/05/11 15:53:06 keithw Exp $ */
+/* $Id: t_imm_dlist.c,v 1.19 2001/05/14 09:00:51 keithw Exp $ */
/*
* Mesa 3-D graphics library
TNLvertexcassette *node = (TNLvertexcassette *)data;
struct immediate *IM = node->IM;
+/* fprintf(stderr, "%s\n", __FUNCTION__); */
+
if (ctx->NewState)
_mesa_update_state(ctx);
{
struct immediate *IM = TNL_CURRENT_IM(ctx);
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-
ctx->swtnl_im = 0;
IM->ref_count--;
-/* $Id: t_imm_eval.c,v 1.12 2001/05/09 11:06:30 keithw Exp $ */
+/* $Id: t_imm_eval.c,v 1.13 2001/05/14 09:00:51 keithw Exp $ */
/*
* Mesa 3-D graphics library
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Whitwell <keithw@valinux.com>
+ *
*/
-/* $Id: t_imm_exec.c,v 1.24 2001/05/11 08:11:31 keithw Exp $ */
+/* $Id: t_imm_exec.c,v 1.25 2001/05/14 09:00:51 keithw Exp $ */
/*
* Mesa 3-D graphics library
IM->ArrayEltFlags = ~ctx->Array._Enabled;
IM->ArrayEltIncr = ctx->Array.Vertex.Enabled ? 1 : 0;
- IM->ArrayEltFlush = !ctx->Array.LockCount;
+ IM->ArrayEltFlush = ctx->Array.LockCount ? FLUSH_ELT_LAZY : FLUSH_ELT_EAGER;
}
void _tnl_reset_exec_input( GLcontext *ctx,
if (IM->FlushElt) {
/* Orflag is computed twice, but only reach this code if app is
* using a mixture of glArrayElement() and glVertex() while
- * arrays are locked.
+ * arrays are locked (else would be in exec_elt_cassette now).
*/
ASSERT(ctx->Array.LockCount);
ASSERT(IM->FlushElt == FLUSH_ELT_LAZY);
TNLcontext *tnl = TNL_CONTEXT(ctx);
_tnl_compute_orflag( IM, IM->Start );
- _tnl_copy_immediate_vertices( ctx, IM ); /* ?? flags, orflag above */
+ _tnl_copy_immediate_vertices( ctx, IM );
_tnl_get_exec_copy_verts( ctx, IM );
if (tnl->pipeline.build_state_changes)
-/* $Id: t_imm_fixup.c,v 1.16 2001/05/11 15:53:06 keithw Exp $ */
+/* $Id: t_imm_fixup.c,v 1.17 2001/05/14 09:00:51 keithw Exp $ */
/*
* Mesa 3-D graphics library
MEMCPY(next->Material[dst], prev->Material[src], 2*sizeof(GLmaterial));
}
+static GLboolean is_fan_like[GL_POLYGON+1] = {
+ GL_FALSE,
+ GL_FALSE,
+ GL_FALSE,
+ GL_TRUE, /* line loop */
+ GL_FALSE,
+ GL_FALSE,
+ GL_TRUE, /* tri fan */
+ GL_FALSE,
+ GL_FALSE,
+ GL_TRUE /* polygon */
+};
/* Copy the untransformed data from the shared vertices of a primitive
/* prev->CopyOrFlag is hacked to include values generated by eval:
*/
GLuint copy = tnl->pipeline.inputs & prev->CopyOrFlag;
-
- next->TexSize |= tnl->ExecCopyTexSize;
+ GLuint flag;
+
+ if (is_fan_like[ctx->Driver.CurrentExecPrimitive]) {
+ next->TexSize |= tnl->ExecCopyTexSize;
+ next->CopyOrFlag |= (prev->CopyOrFlag & VERT_FIXUP);
+ next->CopyAndFlag &= (prev->CopyOrFlag & VERT_FIXUP);
+ flag = (prev->CopyOrFlag & VERT_FIXUP);
+ }
+ else {
+ /* Don't let an early 'glColor', etc. poison the elt path.
+ */
+ next->CopyAndFlag &= (prev->OrFlag & VERT_FIXUP);
+ flag = (prev->OrFlag & VERT_FIXUP);
+ }
+
/* Copy whole vertices
*/
next->FogCoord[dst] = prev->FogCoord[src];
}
- next->Flag[dst] = (prev->CopyOrFlag & VERT_FIXUP);
+ next->Flag[dst] = flag;
+ next->OrFlag |= prev->Flag[src]; /* for non-fanlike prims,
+ otherwise redundant */
}
-
- next->CopyOrFlag |= (prev->CopyOrFlag & VERT_FIXUP);
- next->CopyAndFlag &= (prev->CopyOrFlag & VERT_FIXUP);
}
if (--tnl->ExecCopySource->ref_count == 0)