summaryrefslogtreecommitdiff
path: root/src/mesa/tnl/t_save_api.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2005-04-23 11:55:18 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2005-04-23 11:55:18 +0000
commitdf943a40411d2b71381e5053d7c59e8cd2400fff (patch)
treee10d686768dc55bd5b60cfbac2e79fa5380bc9a3 /src/mesa/tnl/t_save_api.c
parent0d4af83f252d51f504b7df59a9fab7f83672b9ba (diff)
Fix the worst problems with dangling edgeflag references in
display lists. These mainly arise from edgeflag being the only attribute no longer stored internally as a float and requiring various special case paths to accomodate it.
Diffstat (limited to 'src/mesa/tnl/t_save_api.c')
-rw-r--r--src/mesa/tnl/t_save_api.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/mesa/tnl/t_save_api.c b/src/mesa/tnl/t_save_api.c
index 28bd376fc0..67fee8e29a 100644
--- a/src/mesa/tnl/t_save_api.c
+++ b/src/mesa/tnl/t_save_api.c
@@ -377,12 +377,16 @@ static void _save_copy_to_current( GLcontext *ctx )
}
}
- /* Edgeflag requires special treatment:
+ /* Edgeflag requires special treatment:
+ *
+ * TODO: change edgeflag to GLfloat in Mesa.
*/
if (tnl->save.attrsz[_TNL_ATTRIB_EDGEFLAG]) {
ctx->ListState.ActiveEdgeFlag = 1;
+ tnl->save.CurrentFloatEdgeFlag =
+ tnl->save.attrptr[_TNL_ATTRIB_EDGEFLAG][0];
ctx->ListState.CurrentEdgeFlag =
- (tnl->save.attrptr[_TNL_ATTRIB_EDGEFLAG][0] == 1.0);
+ (tnl->save.CurrentFloatEdgeFlag == 1.0);
}
}
@@ -403,9 +407,10 @@ static void _save_copy_from_current( GLcontext *ctx )
/* Edgeflag requires special treatment:
*/
- if (tnl->save.attrsz[_TNL_ATTRIB_EDGEFLAG])
- tnl->save.attrptr[_TNL_ATTRIB_EDGEFLAG][0] =
- (GLfloat)ctx->ListState.CurrentEdgeFlag;
+ if (tnl->save.attrsz[_TNL_ATTRIB_EDGEFLAG]) {
+ tnl->save.CurrentFloatEdgeFlag = (GLfloat)ctx->ListState.CurrentEdgeFlag;
+ tnl->save.attrptr[_TNL_ATTRIB_EDGEFLAG][0] = tnl->save.CurrentFloatEdgeFlag;
+ }
}
@@ -480,8 +485,9 @@ static void _save_upgrade_vertex( GLcontext *ctx,
if (tnl->save.currentsz[attr][0] == 0) {
assert(oldsz == 0);
tnl->save.dangling_attr_ref = GL_TRUE;
- _mesa_debug(NULL, "_save_upgrade_vertex: dangling reference attr %d\n",
- attr);
+
+/* _mesa_debug(NULL, "_save_upgrade_vertex: dangling reference attr %d\n", */
+/* attr); */
#if 0
/* The current strategy is to punt these degenerate cases
@@ -1653,7 +1659,8 @@ static void _save_current_init( GLcontext *ctx )
tnl->save.currentsz[_TNL_ATTRIB_INDEX] = &ctx->ListState.ActiveIndex;
tnl->save.current[_TNL_ATTRIB_INDEX] = &ctx->ListState.CurrentIndex;
- /* Current edgeflag is handled individually */
+ tnl->save.currentsz[_TNL_ATTRIB_EDGEFLAG] = &ctx->ListState.ActiveEdgeFlag;
+ tnl->save.current[_TNL_ATTRIB_EDGEFLAG] = &tnl->save.CurrentFloatEdgeFlag;
}
/**