summaryrefslogtreecommitdiff
path: root/src/mesa/vbo/vbo_save_api.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-09-15 13:47:25 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-09-15 13:49:04 +0100
commitbd953e872f22690bd232a758383883100d9347d0 (patch)
tree470787ea49e049a39e47d7dc2a46980a1b748043 /src/mesa/vbo/vbo_save_api.c
parenta30d2c5727b67a88feee9aff2f7d9128fca9408b (diff)
mesa: get another class of degenerate dlists working
Primitive begin in one dlist, end in another.
Diffstat (limited to 'src/mesa/vbo/vbo_save_api.c')
-rw-r--r--src/mesa/vbo/vbo_save_api.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index 88d573f128..f93ef3a02a 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -1045,6 +1045,30 @@ void vbo_save_NewList( GLcontext *ctx, GLuint list, GLenum mode )
void vbo_save_EndList( GLcontext *ctx )
{
struct vbo_save_context *save = &vbo_context(ctx)->save;
+
+ /* EndList called inside a (saved) Begin/End pair?
+ */
+ if (ctx->Driver.CurrentSavePrimitive != PRIM_OUTSIDE_BEGIN_END) {
+ GLint i = save->prim_count - 1;
+
+ ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
+ save->prim[i].end = 0;
+ save->prim[i].count = (save->vert_count -
+ save->prim[i].start);
+
+ /* Make sure this vertex list gets replayed by the "loopback"
+ * mechanism:
+ */
+ save->dangling_attr_ref = 1;
+ vbo_save_SaveFlushVertices( ctx );
+
+ /* Swap out this vertex format while outside begin/end. Any color,
+ * etc. received between here and the next begin will be compiled
+ * as opcodes.
+ */
+ _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
+ }
+
unmap_vertex_store( ctx, save->vertex_store );
assert(save->vertex_size == 0);