diff options
author | Brian Paul <[email protected]> | 2018-01-23 10:48:51 -0700 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2018-01-26 19:53:01 +0000 |
commit | 2d7035ee48ce2f6f502243f1b8d51a5339172788 (patch) | |
tree | 0e6adfa9471876f22fca1d2f472531dd9f24751a /src | |
parent | 80ca933e687de5801295cc00f50c887601a13b25 (diff) |
vbo: fix incorrect min/max_index values in display list draw call
This fixes another regression from commit 8e4efdc895ea ("vbo: optimize
some display list drawing"). The problem was the min_index, max_index
values passed to the vbo drawing function were not computed to compensate
for the biased prim::start values.
https://bugs.freedesktop.org/show_bug.cgi?id=104746
https://bugs.freedesktop.org/show_bug.cgi?id=104742
https://bugs.freedesktop.org/show_bug.cgi?id=104690
Tested-by: Clayton Craft <[email protected]>
Fixes: 8e4efdc895ea ("vbo: optimize some display list drawing")
Reviewed-by: Emil Velikov <[email protected]>
(cherry picked from commit 365a48abddcabf6596c2e34a784d91c8ab929918)
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/vbo/vbo_save.h | 3 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_save_api.c | 3 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_save_draw.c | 5 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/mesa/vbo/vbo_save.h b/src/mesa/vbo/vbo_save.h index 274d667be78..4d1bada3e6c 100644 --- a/src/mesa/vbo/vbo_save.h +++ b/src/mesa/vbo/vbo_save.h @@ -74,7 +74,8 @@ struct vbo_save_vertex_list { GLuint current_size; GLuint buffer_offset; /**< in bytes */ - GLuint vertex_count; + GLuint start_vertex; /**< first vertex used by any primitive */ + GLuint vertex_count; /**< number of vertices in this list */ GLuint wrap_count; /* number of copied vertices at start */ GLboolean dangling_attr_ref; /* current attr implicitly referenced outside the list */ diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 1c575448773..66dab4abb5c 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -558,6 +558,9 @@ compile_vertex_list(struct gl_context *ctx) for (unsigned i = 0; i < save->prim_count; i++) { save->prims[i].start += start_offset; } + node->start_vertex = start_offset; + } else { + node->start_vertex = 0; } /* Reset our structures for the next run of vertices: diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index ddf911700f8..16871edf520 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -325,13 +325,14 @@ vbo_save_playback_vertex_list(struct gl_context *ctx, void *data) _mesa_update_state(ctx); if (node->vertex_count > 0) { + GLuint min_index = node->start_vertex; + GLuint max_index = min_index + node->vertex_count - 1; vbo_context(ctx)->draw_prims(ctx, node->prims, node->prim_count, NULL, GL_TRUE, - 0, /* Node is a VBO, so this is ok */ - node->vertex_count - 1, + min_index, max_index, NULL, 0, NULL); } } |