diff options
author | Keith Whitwell <[email protected]> | 2008-09-18 18:57:46 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2008-09-18 19:03:02 +0100 |
commit | 89ab66448e1bcd78caab6678261c2885dcff741c (patch) | |
tree | be36d7e3eba3f64e54da34ff7ba64b3eb14e56aa /src/mesa/vbo/vbo_save_api.c | |
parent | 1074e8e4e47bb4af73c7ef730d0fec40e826cc7e (diff) | |
parent | 5e530d8384b0d9bb867d6407315587c84a443902 (diff) |
Merge commit 'origin/master' into gallium-0.2
Conflicts:
progs/trivial/Makefile
src/mesa/glapi/glthread.c
Diffstat (limited to 'src/mesa/vbo/vbo_save_api.c')
-rw-r--r-- | src/mesa/vbo/vbo_save_api.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 88d573f1283..f69a33d8176 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -1045,6 +1045,32 @@ 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) { + + if (save->prim_count > 0) { + 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); |