diff options
author | Marek Olšák <[email protected]> | 2012-04-23 18:20:56 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-05-08 15:57:51 +0200 |
commit | 50f7e75f9e945cfbb2ae868cc961a2205a0b6e73 (patch) | |
tree | d55b1c38416040b9df653df6327dbaa0e82866fc /src/mesa/vbo/vbo_split_inplace.c | |
parent | a7ac9c9c7dc7401ca6143d1e7476df5e3c2758b7 (diff) |
mesa: move gl_client_array*[] from vbo_draw_func into gl_context
In the future we'd like to treat vertex arrays as a state and
not as a parameter to the draw function. This is the first step
towards that goal. Part of the goal is to avoid array re-validation
for every draw call.
This commit adds:
const struct gl_client_array **gl_context::Array::_DrawArrays.
The pointer is changed in:
* vbo_draw_method
* vbo_rebase_prims - unused by gallium
* vbo_split_prims - unused by gallium
* st_RasterPos
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_split_inplace.c')
-rw-r--r-- | src/mesa/vbo/vbo_split_inplace.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/vbo/vbo_split_inplace.c b/src/mesa/vbo/vbo_split_inplace.c index 9e596f66891..7c2cc3ece5a 100644 --- a/src/mesa/vbo/vbo_split_inplace.c +++ b/src/mesa/vbo/vbo_split_inplace.c @@ -62,6 +62,8 @@ struct split_context { static void flush_vertex( struct split_context *split ) { + struct gl_context *ctx = split->ctx; + const struct gl_client_array **saved_arrays = ctx->Array._DrawArrays; struct _mesa_index_buffer ib; GLuint i; @@ -82,8 +84,9 @@ static void flush_vertex( struct split_context *split ) assert(split->max_index >= split->min_index); - split->draw(split->ctx, - split->array, + ctx->Array._DrawArrays = split->array; + + split->draw(ctx, split->dstprim, split->dstprim_nr, split->ib ? &ib : NULL, @@ -92,6 +95,8 @@ static void flush_vertex( struct split_context *split ) split->max_index, NULL); + ctx->Array._DrawArrays = saved_arrays; + split->dstprim_nr = 0; split->min_index = ~0; split->max_index = 0; |