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/drivers | |
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/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_draw.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_draw.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c | 9 |
3 files changed, 5 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index da37b181f6e..813f7c8e570 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -531,7 +531,6 @@ retry: } void brw_draw_prims( struct gl_context *ctx, - const struct gl_client_array *arrays[], const struct _mesa_prim *prim, GLuint nr_prims, const struct _mesa_index_buffer *ib, @@ -540,6 +539,7 @@ void brw_draw_prims( struct gl_context *ctx, GLuint max_index, struct gl_transform_feedback_object *tfb_vertcount ) { + const struct gl_client_array **arrays = ctx->Array._DrawArrays; bool retval; if (!_mesa_check_conditional_render(ctx)) diff --git a/src/mesa/drivers/dri/i965/brw_draw.h b/src/mesa/drivers/dri/i965/brw_draw.h index b91041932e1..2cc4cb38379 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.h +++ b/src/mesa/drivers/dri/i965/brw_draw.h @@ -35,7 +35,6 @@ struct brw_context; void brw_draw_prims( struct gl_context *ctx, - const struct gl_client_array *arrays[], const struct _mesa_prim *prims, GLuint nr_prims, const struct _mesa_index_buffer *ib, diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c index 62fee2e1e27..a9a56e78f2d 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c @@ -216,7 +216,7 @@ get_max_client_stride(struct gl_context *ctx, const struct gl_client_array **arr } static void -TAG(vbo_render_prims)(struct gl_context *ctx, const struct gl_client_array **arrays, +TAG(vbo_render_prims)(struct gl_context *ctx, const struct _mesa_prim *prims, GLuint nr_prims, const struct _mesa_index_buffer *ib, GLboolean index_bounds_valid, @@ -448,7 +448,6 @@ vbo_draw_imm(struct gl_context *ctx, const struct gl_client_array **arrays, static void TAG(vbo_render_prims)(struct gl_context *ctx, - const struct gl_client_array **arrays, const struct _mesa_prim *prims, GLuint nr_prims, const struct _mesa_index_buffer *ib, GLboolean index_bounds_valid, @@ -456,6 +455,7 @@ TAG(vbo_render_prims)(struct gl_context *ctx, struct gl_transform_feedback_object *tfb_vertcount) { struct nouveau_render_state *render = to_render_state(ctx); + const struct gl_client_array **arrays = ctx->Array._DrawArrays; if (!index_bounds_valid) vbo_get_minmax_indices(ctx, prims, ib, &min_index, &max_index, @@ -484,7 +484,6 @@ TAG(vbo_render_prims)(struct gl_context *ctx, static void TAG(vbo_check_render_prims)(struct gl_context *ctx, - const struct gl_client_array **arrays, const struct _mesa_prim *prims, GLuint nr_prims, const struct _mesa_index_buffer *ib, GLboolean index_bounds_valid, @@ -496,12 +495,12 @@ TAG(vbo_check_render_prims)(struct gl_context *ctx, nouveau_validate_framebuffer(ctx); if (nctx->fallback == HWTNL) - TAG(vbo_render_prims)(ctx, arrays, prims, nr_prims, ib, + TAG(vbo_render_prims)(ctx, prims, nr_prims, ib, index_bounds_valid, min_index, max_index, tfb_vertcount); if (nctx->fallback == SWTNL) - _tnl_vbo_draw_prims(ctx, arrays, prims, nr_prims, ib, + _tnl_vbo_draw_prims(ctx, prims, nr_prims, ib, index_bounds_valid, min_index, max_index, tfb_vertcount); } |