diff options
author | Keith Whitwell <[email protected]> | 2003-12-03 10:15:17 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2003-12-03 10:15:17 +0000 |
commit | 6ff60049a4ab1abac46e5c8e317b0dd842e088c2 (patch) | |
tree | 07710f102d6ac96a780a6a2f69ed69a093ff9439 /src/mesa/tnl/t_save_api.c | |
parent | 9b0dcfd4080200a35478f2a006969ea529763ed3 (diff) |
Ensure PRIM_BEGIN marker isn't lost when incomplete primitives are wrapped.
Diffstat (limited to 'src/mesa/tnl/t_save_api.c')
-rw-r--r-- | src/mesa/tnl/t_save_api.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/mesa/tnl/t_save_api.c b/src/mesa/tnl/t_save_api.c index 1fe2ff6d442..92fd3369531 100644 --- a/src/mesa/tnl/t_save_api.c +++ b/src/mesa/tnl/t_save_api.c @@ -306,6 +306,7 @@ static void _save_wrap_buffers( GLcontext *ctx ) TNLcontext *tnl = TNL_CONTEXT(ctx); GLint i = tnl->save.prim_count - 1; GLenum mode; + GLuint count; assert(i < (GLint) tnl->save.prim_max); assert(i >= 0); @@ -314,7 +315,9 @@ static void _save_wrap_buffers( GLcontext *ctx ) */ tnl->save.prim[i].count = ((tnl->save.initial_counter - tnl->save.counter) - tnl->save.prim[i].start); - mode = tnl->save.prim[i].mode & ~(PRIM_BEGIN|PRIM_END); + count = tnl->save.prim[i].count; + mode = tnl->save.prim[i].mode; + /* store the copied vertices, and allocate a new list. */ @@ -322,10 +325,19 @@ static void _save_wrap_buffers( GLcontext *ctx ) /* Restart interrupted primitive */ - tnl->save.prim[0].mode = mode; - tnl->save.prim[0].start = 0; - tnl->save.prim[0].count = 0; - tnl->save.prim_count = 1; + if (!(mode & PRIM_END)) { + + if (count == tnl->save.copied.nr) + tnl->save.prim[0].mode = mode; + else + tnl->save.prim[0].mode = mode & ~PRIM_BEGIN; + + tnl->save.prim[0].start = 0; + tnl->save.prim[0].count = 0; + tnl->save.prim_count = 1; + } + else + tnl->save.prim_count = 0; } |