From 14bb957b996dcc5392b8fa589bd3ffa5c55cb6b4 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 9 Dec 2011 17:00:23 +0100 Subject: mesa: implement DrawTransformFeedback from ARB_transform_feedback2 It's like DrawArrays, but the count is taken from a transform feedback object. This removes DrawTransformFeedback from dd_function_table and adds the same function to GLvertexformat (with the function parameters matching GL). The vbo_draw_func callback has a new parameter "struct gl_transform_feedback_object *tfb_vertcount". The rest of the code just validates states and forwards the transform feedback object into vbo_draw_func. --- src/mesa/drivers/dri/i965/brw_draw.c | 3 ++- src/mesa/drivers/dri/i965/brw_draw.h | 3 ++- src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c | 15 ++++++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index bf3c95cbebc..6627a484a42 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -517,7 +517,8 @@ void brw_draw_prims( struct gl_context *ctx, const struct _mesa_index_buffer *ib, GLboolean index_bounds_valid, GLuint min_index, - GLuint max_index ) + GLuint max_index, + struct gl_transform_feedback_object *tfb_vertcount ) { bool retval; diff --git a/src/mesa/drivers/dri/i965/brw_draw.h b/src/mesa/drivers/dri/i965/brw_draw.h index 1fe417296f6..b91041932e1 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.h +++ b/src/mesa/drivers/dri/i965/brw_draw.h @@ -41,7 +41,8 @@ void brw_draw_prims( struct gl_context *ctx, const struct _mesa_index_buffer *ib, GLboolean index_bounds_valid, GLuint min_index, - GLuint max_index ); + GLuint max_index, + struct gl_transform_feedback_object *tfb_vertcount ); void brw_draw_init( struct brw_context *brw ); void brw_draw_destroy( struct brw_context *brw ); diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c index d8b331cca76..de04d1897c1 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c @@ -219,7 +219,8 @@ TAG(vbo_render_prims)(struct gl_context *ctx, const struct gl_client_array **arr const struct _mesa_prim *prims, GLuint nr_prims, const struct _mesa_index_buffer *ib, GLboolean index_bounds_valid, - GLuint min_index, GLuint max_index); + GLuint min_index, GLuint max_index, + struct gl_transform_feedback_object *tfb_vertcount); static GLboolean vbo_maybe_split(struct gl_context *ctx, const struct gl_client_array **arrays, @@ -430,7 +431,8 @@ 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, - GLuint min_index, GLuint max_index) + GLuint min_index, GLuint max_index, + struct gl_transform_feedback_object *tfb_vertcount) { struct nouveau_render_state *render = to_render_state(ctx); @@ -464,7 +466,8 @@ TAG(vbo_check_render_prims)(struct gl_context *ctx, const struct _mesa_prim *prims, GLuint nr_prims, const struct _mesa_index_buffer *ib, GLboolean index_bounds_valid, - GLuint min_index, GLuint max_index) + GLuint min_index, GLuint max_index, + struct gl_transform_feedback_object *tfb_vertcount) { struct nouveau_context *nctx = to_nouveau_context(ctx); @@ -472,11 +475,13 @@ TAG(vbo_check_render_prims)(struct gl_context *ctx, if (nctx->fallback == HWTNL) TAG(vbo_render_prims)(ctx, arrays, prims, nr_prims, ib, - index_bounds_valid, min_index, max_index); + index_bounds_valid, min_index, max_index, + tfb_vertcount); if (nctx->fallback == SWTNL) _tnl_vbo_draw_prims(ctx, arrays, prims, nr_prims, ib, - index_bounds_valid, min_index, max_index); + index_bounds_valid, min_index, max_index, + tfb_vertcount); } void -- cgit v1.2.3