diff options
author | Jakob Bornecrantz <[email protected]> | 2009-07-03 18:53:58 +0200 |
---|---|---|
committer | Jakob Bornecrantz <[email protected]> | 2009-07-03 18:53:58 +0200 |
commit | 862488075c5537b0613753b0d14c267527fc6199 (patch) | |
tree | fd4d51272c86fbc88c12e2d16649547f3ca7b8df /src/mesa/vbo | |
parent | 060c7f2321f72503c14f9f3f7bb27d59d8a90224 (diff) | |
parent | 94e1117c9ba259665cd8e790369dcd4c789a2f93 (diff) |
Merge branch 'mesa_7_5_branch'
Conflicts:
src/mesa/main/dlist.c
src/mesa/vbo/vbo_save_api.c
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r-- | src/mesa/vbo/vbo_exec_draw.c | 2 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_save_api.c | 56 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_save_loopback.c | 2 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_split_copy.c | 2 |
4 files changed, 38 insertions, 24 deletions
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index bfe9ef0a483..18419928b26 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -51,7 +51,7 @@ vbo_exec_debug_verts( struct vbo_exec_context *exec ) struct _mesa_prim *prim = &exec->vtx.prim[i]; _mesa_printf(" prim %d: %s%s %d..%d %s %s\n", i, - _mesa_lookup_enum_by_nr(prim->mode), + _mesa_lookup_prim_by_nr(prim->mode), prim->weak ? " (weak)" : "", prim->start, prim->start + prim->count, diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 3c4c8acc638..f8e46ff9c94 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -667,19 +667,33 @@ do { \ * -- Flush current buffer * -- Fallback to opcodes for the rest of the begin/end object. */ -#define DO_FALLBACK(ctx) \ -do { \ - struct vbo_save_context *save = &vbo_context(ctx)->save; \ - \ - if (save->vert_count || save->prim_count) \ - _save_compile_vertex_list( ctx ); \ - \ - _save_copy_to_current( ctx ); \ - _save_reset_vertex( ctx ); \ - _save_reset_counters( ctx ); \ - _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); \ - ctx->Driver.SaveNeedFlush = 0; \ -} while (0) +static void DO_FALLBACK( GLcontext *ctx ) +{ + struct vbo_save_context *save = &vbo_context(ctx)->save; + + if (save->vert_count || save->prim_count) { + GLint i = save->prim_count - 1; + + /* Close off in-progress primitive. + */ + save->prim[i].count = (save->vert_count - + save->prim[i].start); + + /* Need to replay this display list with loopback, + * unfortunately, otherwise this primitive won't be handled + * properly: + */ + save->dangling_attr_ref = 1; + + _save_compile_vertex_list( ctx ); + } + + _save_copy_to_current( ctx ); + _save_reset_vertex( ctx ); + _save_reset_counters( ctx ); + _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); + ctx->Driver.SaveNeedFlush = 0; +} static void GLAPIENTRY _save_EvalCoord1f( GLfloat u ) { @@ -1146,14 +1160,14 @@ static void vbo_print_vertex_list( GLcontext *ctx, void *data ) for (i = 0 ; i < node->prim_count ; i++) { struct _mesa_prim *prim = &node->prim[i]; - _mesa_printf(" prim %d: %s%s %d..%d %s %s\n", - i, - _mesa_lookup_enum_by_nr(prim->mode), - prim->weak ? " (weak)" : "", - prim->start, - prim->start + prim->count, - (prim->begin) ? "BEGIN" : "(wrap)", - (prim->end) ? "END" : "(wrap)"); + _mesa_debug(NULL, " prim %d: %s%s %d..%d %s %s\n", + i, + _mesa_lookup_prim_by_nr(prim->mode), + prim->weak ? " (weak)" : "", + prim->start, + prim->start + prim->count, + (prim->begin) ? "BEGIN" : "(wrap)", + (prim->end) ? "END" : "(wrap)"); } } diff --git a/src/mesa/vbo/vbo_save_loopback.c b/src/mesa/vbo/vbo_save_loopback.c index 92ca4ea95d3..b7a74e4535a 100644 --- a/src/mesa/vbo/vbo_save_loopback.c +++ b/src/mesa/vbo/vbo_save_loopback.c @@ -97,7 +97,7 @@ static void loopback_prim( GLcontext *ctx, if (0) _mesa_printf("loopback prim %s(%s,%s) verts %d..%d\n", - _mesa_lookup_enum_by_nr(prim->mode), + _mesa_lookup_prim_by_nr(prim->mode), prim->begin ? "begin" : "..", prim->end ? "end" : "..", start, diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c index dcb14c868b8..d7ffebf6076 100644 --- a/src/mesa/vbo/vbo_split_copy.c +++ b/src/mesa/vbo/vbo_split_copy.c @@ -219,7 +219,7 @@ begin( struct copy_context *copy, GLenum mode, GLboolean begin_flag ) { struct _mesa_prim *prim = ©->dstprim[copy->dstprim_nr]; -/* _mesa_printf("begin %s (%d)\n", _mesa_lookup_enum_by_nr(mode), begin_flag); */ +/* _mesa_printf("begin %s (%d)\n", _mesa_lookup_prim_by_nr(mode), begin_flag); */ prim->mode = mode; prim->begin = begin_flag; |