diff options
author | Eric Anholt <[email protected]> | 2009-08-27 10:09:24 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2009-09-08 15:12:20 -0700 |
commit | 92d7ed8a20d4a018ce5324e6537ae7b478b9e5bf (patch) | |
tree | db04f9d7c60b1cd174c93fbe112f00058c85e092 /src/mesa/vbo/vbo_split_copy.c | |
parent | ec9e7295800aff0f04815de736127101f770033f (diff) |
mesa: Add support for ARB_draw_elements_base_vertex.
Diffstat (limited to 'src/mesa/vbo/vbo_split_copy.c')
-rw-r--r-- | src/mesa/vbo/vbo_split_copy.c | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c index 8ec180d5508..c45190b9dd3 100644 --- a/src/mesa/vbo/vbo_split_copy.c +++ b/src/mesa/vbo/vbo_split_copy.c @@ -589,28 +589,40 @@ void vbo_split_copy( GLcontext *ctx, const struct split_limits *limits ) { struct copy_context copy; - GLuint i; + GLuint i, this_nr_prims; + + for (i = 0; i < nr_prims;) { + /* Our SW TNL pipeline doesn't handle basevertex yet, so bind_indices + * will rebase the elements to the basevertex, and we'll only + * emit strings of prims with the same basevertex in one draw call. + */ + for (this_nr_prims = 1; i + this_nr_prims < nr_prims; + this_nr_prims++) { + if (prim[i].basevertex != prim[i + this_nr_prims].basevertex) + break; + } - memset(©, 0, sizeof(copy)); + memset(©, 0, sizeof(copy)); - /* Require indexed primitives: - */ - assert(ib); - - copy.ctx = ctx; - copy.array = arrays; - copy.prim = prim; - copy.nr_prims = nr_prims; - copy.ib = ib; - copy.draw = draw; - copy.limits = limits; + /* Require indexed primitives: + */ + assert(ib); - /* Clear the vertex cache: - */ - for (i = 0; i < ELT_TABLE_SIZE; i++) - copy.vert_cache[i].in = ~0; + copy.ctx = ctx; + copy.array = arrays; + copy.prim = &prim[i]; + copy.nr_prims = this_nr_prims; + copy.ib = ib; + copy.draw = draw; + copy.limits = limits; - replay_init(©); - replay_elts(©); - replay_finish(©); + /* Clear the vertex cache: + */ + for (i = 0; i < ELT_TABLE_SIZE; i++) + copy.vert_cache[i].in = ~0; + + replay_init(©); + replay_elts(©); + replay_finish(©); + } } |