aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl/t_imm_fixup.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2001-05-14 09:00:51 +0000
committerKeith Whitwell <[email protected]>2001-05-14 09:00:51 +0000
commit9cf779e7ac5509aa2d8706b882e9a6b43837cebd (patch)
tree69a56d30db28bf0f2157c8354d965485b3136edd /src/mesa/tnl/t_imm_fixup.c
parentb8d091d3503415a29a309dca0ce13b24509bd763 (diff)
Fix for glean texgen test.
Diffstat (limited to 'src/mesa/tnl/t_imm_fixup.c')
-rw-r--r--src/mesa/tnl/t_imm_fixup.c38
1 files changed, 31 insertions, 7 deletions
diff --git a/src/mesa/tnl/t_imm_fixup.c b/src/mesa/tnl/t_imm_fixup.c
index 53005852811..ea51850e21c 100644
--- a/src/mesa/tnl/t_imm_fixup.c
+++ b/src/mesa/tnl/t_imm_fixup.c
@@ -1,4 +1,4 @@
-/* $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
@@ -364,6 +364,18 @@ static void copy_material( struct immediate *next,
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
@@ -412,8 +424,21 @@ void _tnl_copy_immediate_vertices( GLcontext *ctx, struct immediate *next )
/* 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
*/
@@ -464,11 +489,10 @@ void _tnl_copy_immediate_vertices( GLcontext *ctx, struct immediate *next )
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)