From 50f7e75f9e945cfbb2ae868cc961a2205a0b6e73 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 23 Apr 2012 18:20:56 +0200 Subject: 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 --- src/mesa/vbo/vbo_context.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/mesa/vbo/vbo_context.h') diff --git a/src/mesa/vbo/vbo_context.h b/src/mesa/vbo/vbo_context.h index a6397ba2f8f..93c48cd029b 100644 --- a/src/mesa/vbo/vbo_context.h +++ b/src/mesa/vbo/vbo_context.h @@ -131,6 +131,21 @@ vbo_draw_method(struct vbo_context *vbo, enum draw_method method) { if (vbo->last_draw_method != method) { struct gl_context *ctx = vbo->exec.ctx; + + switch (method) { + case DRAW_ARRAYS: + ctx->Array._DrawArrays = vbo->exec.array.inputs; + break; + case DRAW_BEGIN_END: + ctx->Array._DrawArrays = vbo->exec.vtx.inputs; + break; + case DRAW_DISPLAY_LIST: + ctx->Array._DrawArrays = vbo->save.inputs; + break; + default: + ASSERT(0); + } + ctx->Driver.UpdateState(ctx, _NEW_ARRAY); vbo->last_draw_method = method; } -- cgit v1.2.3