From 950ee0a3700ece300129b15075fe67b56ff45ea6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 10 Feb 2020 20:02:30 -0500 Subject: [PATCH] mesa: remove unused "indirect" parameter from Driver.Draw Reviewed-by: Ian Romanick Part-of: --- src/mesa/drivers/dri/i965/brw_draw.c | 8 +++----- src/mesa/drivers/dri/i965/brw_draw.h | 3 +-- .../drivers/dri/i965/brw_primitive_restart.c | 3 +-- src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c | 18 +++++++----------- src/mesa/main/dd.h | 2 +- src/mesa/main/draw.c | 10 +++++----- src/mesa/state_tracker/st_cb_rasterpos.c | 2 +- src/mesa/state_tracker/st_draw.c | 5 +---- src/mesa/state_tracker/st_draw.h | 3 +-- src/mesa/state_tracker/st_draw_feedback.c | 3 +-- src/mesa/tnl/t_draw.c | 7 +++---- src/mesa/tnl/t_rebase.c | 2 +- src/mesa/tnl/t_split_copy.c | 2 +- src/mesa/tnl/t_split_inplace.c | 2 +- src/mesa/tnl/tnl.h | 9 +++------ src/mesa/vbo/vbo_exec_draw.c | 2 +- src/mesa/vbo/vbo_primitive_restart.c | 4 ++-- src/mesa/vbo/vbo_save_draw.c | 2 +- 18 files changed, 35 insertions(+), 52 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 92c57742d75..a8dd1572bac 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -1104,8 +1104,7 @@ brw_draw_prims(struct gl_context *ctx, GLuint min_index, GLuint max_index, struct gl_transform_feedback_object *gl_xfb_obj, - unsigned stream, - UNUSED struct gl_buffer_object *unused_indirect) + unsigned stream) { unsigned i; struct brw_context *brw = brw_context(ctx); @@ -1131,7 +1130,7 @@ brw_draw_prims(struct gl_context *ctx, _swsetup_Wakeup(ctx); _tnl_wakeup(ctx); _tnl_draw(ctx, prims, nr_prims, ib, - index_bounds_valid, min_index, max_index, NULL, 0, NULL); + index_bounds_valid, min_index, max_index, NULL, 0); return; } @@ -1234,8 +1233,7 @@ brw_draw_indirect_prims(struct gl_context *ctx, brw_draw_prims(ctx, prim, draw_count, ib, false, 0, ~0, - NULL, 0, - NULL); + NULL, 0); brw->draw.draw_indirect_data = NULL; free(prim); diff --git a/src/mesa/drivers/dri/i965/brw_draw.h b/src/mesa/drivers/dri/i965/brw_draw.h index 1e111fe7431..ddbf6238a17 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.h +++ b/src/mesa/drivers/dri/i965/brw_draw.h @@ -52,8 +52,7 @@ void brw_draw_prims(struct gl_context *ctx, GLuint min_index, GLuint max_index, struct gl_transform_feedback_object *unused_tfb_object, - unsigned stream, - struct gl_buffer_object *indirect ); + unsigned stream); void brw_init_draw_functions(struct dd_function_table *functions); void brw_draw_init( struct brw_context *brw ); diff --git a/src/mesa/drivers/dri/i965/brw_primitive_restart.c b/src/mesa/drivers/dri/i965/brw_primitive_restart.c index 4e4aeeb0a80..dfb9735ef29 100644 --- a/src/mesa/drivers/dri/i965/brw_primitive_restart.c +++ b/src/mesa/drivers/dri/i965/brw_primitive_restart.c @@ -162,8 +162,7 @@ brw_handle_primitive_restart(struct gl_context *ctx, /* Cut index should work for primitive restart, so use it */ brw->prim_restart.enable_cut_index = true; - brw_draw_prims(ctx, prims, nr_prims, ib, GL_FALSE, -1, -1, NULL, 0, - NULL); + brw_draw_prims(ctx, prims, nr_prims, ib, GL_FALSE, -1, -1, NULL, 0); brw->prim_restart.enable_cut_index = false; } else { /* Not all the primitive draw modes are supported by the cut index, diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c index 280c0ecc291..d365f7a531a 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c @@ -245,8 +245,7 @@ TAG(vbo_render_prims)(struct gl_context *ctx, GLboolean index_bounds_valid, GLuint min_index, GLuint max_index, struct gl_transform_feedback_object *tfb_vertcount, - unsigned stream, - struct gl_buffer_object *indirect); + unsigned stream); static GLboolean vbo_maybe_split(struct gl_context *ctx, const struct tnl_vertex_array *arrays, @@ -483,8 +482,7 @@ TAG(vbo_render_prims)(struct gl_context *ctx, GLboolean index_bounds_valid, GLuint min_index, GLuint max_index, struct gl_transform_feedback_object *tfb_vertcount, - unsigned stream, - struct gl_buffer_object *indirect) + unsigned stream) { struct nouveau_render_state *render = to_render_state(ctx); @@ -521,8 +519,7 @@ TAG(vbo_check_render_prims)(struct gl_context *ctx, GLboolean index_bounds_valid, GLuint min_index, GLuint max_index, struct gl_transform_feedback_object *tfb_vertcount, - unsigned stream, - struct gl_buffer_object *indirect) + unsigned stream) { struct nouveau_context *nctx = to_nouveau_context(ctx); @@ -531,12 +528,12 @@ 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, - tfb_vertcount, stream, indirect); + tfb_vertcount, stream); if (nctx->fallback == SWTNL) _tnl_draw_prims(ctx, arrays, prims, nr_prims, ib, index_bounds_valid, min_index, max_index, - tfb_vertcount, stream, indirect); + tfb_vertcount, stream); } static void @@ -546,8 +543,7 @@ TAG(vbo_draw)(struct gl_context *ctx, GLboolean index_bounds_valid, GLuint min_index, GLuint max_index, struct gl_transform_feedback_object *tfb_vertcount, - unsigned stream, - struct gl_buffer_object *indirect) + unsigned stream) { /* Borrow and update the inputs list from the tnl context */ const struct tnl_vertex_array* arrays = _tnl_bind_inputs(ctx); @@ -555,7 +551,7 @@ TAG(vbo_draw)(struct gl_context *ctx, TAG(vbo_check_render_prims)(ctx, arrays, prims, nr_prims, ib, index_bounds_valid, min_index, max_index, - tfb_vertcount, stream, indirect); + tfb_vertcount, stream); } void diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 72af158dd07..824f320668b 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -543,7 +543,7 @@ struct dd_function_table { GLboolean index_bounds_valid, GLuint min_index, GLuint max_index, struct gl_transform_feedback_object *tfb_vertcount, - unsigned tfb_stream, struct gl_buffer_object *indirect); + unsigned tfb_stream); /** diff --git a/src/mesa/main/draw.c b/src/mesa/main/draw.c index 5a28c77e42c..4ace7c2df4f 100644 --- a/src/mesa/main/draw.c +++ b/src/mesa/main/draw.c @@ -370,7 +370,7 @@ _mesa_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start, }; ctx->Driver.Draw(ctx, &prim, 1, NULL, - GL_TRUE, start, start + count - 1, NULL, 0, NULL); + GL_TRUE, start, start + count - 1, NULL, 0); if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH) { _mesa_flush(ctx); @@ -810,7 +810,7 @@ _mesa_validated_drawrangeelements(struct gl_context *ctx, GLenum mode, */ ctx->Driver.Draw(ctx, &prim, 1, &ib, - index_bounds_valid, start, end, NULL, 0, NULL); + index_bounds_valid, start, end, NULL, 0); if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH) { _mesa_flush(ctx); @@ -1241,7 +1241,7 @@ _mesa_validated_multidrawelements(struct gl_context *ctx, GLenum mode, } ctx->Driver.Draw(ctx, prim, primcount, &ib, - false, 0, ~0, NULL, 0, NULL); + false, 0, ~0, NULL, 0); } else { /* render one prim at a time */ @@ -1267,7 +1267,7 @@ _mesa_validated_multidrawelements(struct gl_context *ctx, GLenum mode, else prim[0].basevertex = 0; - ctx->Driver.Draw(ctx, prim, 1, &ib, false, 0, ~0, NULL, 0, NULL); + ctx->Driver.Draw(ctx, prim, 1, &ib, false, 0, ~0, NULL, 0); } } @@ -1384,7 +1384,7 @@ _mesa_draw_transform_feedback(struct gl_context *ctx, GLenum mode, * (like in DrawArrays), but we have no way to know how many vertices * will be rendered. */ - ctx->Driver.Draw(ctx, &prim, 1, NULL, GL_FALSE, 0, ~0, obj, stream, NULL); + ctx->Driver.Draw(ctx, &prim, 1, NULL, GL_FALSE, 0, ~0, obj, stream); if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH) { _mesa_flush(ctx); diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c index 44d1586ddb7..b6f22601f82 100644 --- a/src/mesa/state_tracker/st_cb_rasterpos.c +++ b/src/mesa/state_tracker/st_cb_rasterpos.c @@ -264,7 +264,7 @@ st_RasterPos(struct gl_context *ctx, const GLfloat v[4]) /* Draw the point. */ st_feedback_draw_vbo(ctx, &rs->prim, 1, NULL, GL_TRUE, 0, 1, - NULL, 0, NULL); + NULL, 0); /* restore draw's rasterization stage depending on rendermode */ if (ctx->RenderMode == GL_FEEDBACK) { diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 3ff52b0a5e3..d0a27a01d26 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -173,8 +173,7 @@ st_draw_vbo(struct gl_context *ctx, GLuint min_index, GLuint max_index, struct gl_transform_feedback_object *tfb_vertcount, - unsigned stream, - struct gl_buffer_object *indirect) + unsigned stream) { struct st_context *st = st_context(ctx); struct pipe_draw_info info; @@ -235,8 +234,6 @@ st_draw_vbo(struct gl_context *ctx, } } - assert(!indirect); - /* do actual drawing */ for (i = 0; i < nr_prims; i++) { info.count = prims[i].count; diff --git a/src/mesa/state_tracker/st_draw.h b/src/mesa/state_tracker/st_draw.h index 5b897bda118..5c1dd033cd4 100644 --- a/src/mesa/state_tracker/st_draw.h +++ b/src/mesa/state_tracker/st_draw.h @@ -56,8 +56,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, GLuint min_index, GLuint max_index, struct gl_transform_feedback_object *tfb_vertcount, - unsigned stream, - struct gl_buffer_object *indirect); + unsigned stream); /** * When drawing with VBOs, the addresses specified with diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c index 0b70a08a870..813a6388c79 100644 --- a/src/mesa/state_tracker/st_draw_feedback.c +++ b/src/mesa/state_tracker/st_draw_feedback.c @@ -101,8 +101,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, GLuint min_index, GLuint max_index, struct gl_transform_feedback_object *tfb_vertcount, - unsigned stream, - struct gl_buffer_object *indirect) + unsigned stream) { struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 009a0bf3626..a2388b9b14f 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -435,8 +435,7 @@ void _tnl_draw_prims(struct gl_context *ctx, GLuint min_index, GLuint max_index, struct gl_transform_feedback_object *tfb_vertcount, - unsigned stream, - struct gl_buffer_object *indirect) + unsigned stream) { TNLcontext *tnl = TNL_CONTEXT(ctx); const GLuint TEST_SPLIT = 0; @@ -639,7 +638,7 @@ _tnl_draw(struct gl_context *ctx, const struct _mesa_index_buffer *ib, GLboolean index_bounds_valid, GLuint min_index, GLuint max_index, struct gl_transform_feedback_object *tfb_vertcount, - unsigned stream, struct gl_buffer_object *indirect) + unsigned stream) { /* Update TNLcontext::draw_arrays and return that pointer. */ @@ -647,7 +646,7 @@ _tnl_draw(struct gl_context *ctx, _tnl_draw_prims(ctx, arrays, prim, nr_prims, ib, index_bounds_valid, min_index, max_index, - tfb_vertcount, stream, indirect); + tfb_vertcount, stream); } diff --git a/src/mesa/tnl/t_rebase.c b/src/mesa/tnl/t_rebase.c index b6950e04fec..24abcef98a2 100644 --- a/src/mesa/tnl/t_rebase.c +++ b/src/mesa/tnl/t_rebase.c @@ -242,7 +242,7 @@ void t_rebase_prims( struct gl_context *ctx, GL_TRUE, 0, max_index - min_index, - NULL, 0, NULL ); + NULL, 0); free(tmp_indices); diff --git a/src/mesa/tnl/t_split_copy.c b/src/mesa/tnl/t_split_copy.c index b67deb6a3ae..511e46c1e2f 100644 --- a/src/mesa/tnl/t_split_copy.c +++ b/src/mesa/tnl/t_split_copy.c @@ -211,7 +211,7 @@ flush(struct copy_context *copy) GL_TRUE, 0, copy->dstbuf_nr - 1, - NULL, 0, NULL); + NULL, 0); /* Reset all pointers: */ diff --git a/src/mesa/tnl/t_split_inplace.c b/src/mesa/tnl/t_split_inplace.c index 8e9ecb70468..395af573361 100644 --- a/src/mesa/tnl/t_split_inplace.c +++ b/src/mesa/tnl/t_split_inplace.c @@ -93,7 +93,7 @@ flush_vertex( struct split_context *split) !split->ib, split->min_index, split->max_index, - NULL, 0, NULL); + NULL, 0); split->dstprim_nr = 0; split->min_index = ~0; diff --git a/src/mesa/tnl/tnl.h b/src/mesa/tnl/tnl.h index 5d84a1c8a7d..c3927536b8b 100644 --- a/src/mesa/tnl/tnl.h +++ b/src/mesa/tnl/tnl.h @@ -108,16 +108,14 @@ _tnl_draw_prims(struct gl_context *ctx, GLuint min_index, GLuint max_index, struct gl_transform_feedback_object *tfb_vertcount, - unsigned stream, - struct gl_buffer_object *indirect ); + unsigned stream); void _tnl_draw(struct gl_context *ctx, const struct _mesa_prim *prim, GLuint nr_prims, const struct _mesa_index_buffer *ib, GLboolean index_bounds_valid, GLuint min_index, GLuint max_index, - struct gl_transform_feedback_object *tfb_vertcount, unsigned stream, - struct gl_buffer_object *indirect); + struct gl_transform_feedback_object *tfb_vertcount, unsigned stream); extern void _tnl_RasterPos(struct gl_context *ctx, const GLfloat vObj[4]); @@ -175,8 +173,7 @@ typedef void (*tnl_draw_func)(struct gl_context *ctx, GLuint min_index, GLuint max_index, struct gl_transform_feedback_object *tfb_vertcount, - unsigned tfb_stream, - struct gl_buffer_object *indirect); + unsigned tfb_stream); /* Utility function to cope with various constraints on tnl modules or diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 7c3b7ef4330..10e330eb816 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -414,7 +414,7 @@ vbo_exec_vtx_flush(struct vbo_exec_context *exec) ctx->Driver.Draw(ctx, exec->vtx.prim, exec->vtx.prim_count, NULL, GL_TRUE, 0, exec->vtx.vert_count - 1, - NULL, 0, NULL); + NULL, 0); /* Get new storage -- unless asked not to. */ if (!persistent_mapping) diff --git a/src/mesa/vbo/vbo_primitive_restart.c b/src/mesa/vbo/vbo_primitive_restart.c index 1faf3a68229..4f380b6dcba 100644 --- a/src/mesa/vbo/vbo_primitive_restart.c +++ b/src/mesa/vbo/vbo_primitive_restart.c @@ -248,11 +248,11 @@ vbo_sw_primitive_restart(struct gl_context *ctx, (temp_prim.count == sub_prim->count)) { ctx->Driver.Draw(ctx, &temp_prim, 1, ib, GL_TRUE, sub_prim->min_index, sub_prim->max_index, - NULL, 0, NULL); + NULL, 0); } else { ctx->Driver.Draw(ctx, &temp_prim, 1, ib, GL_FALSE, -1, -1, - NULL, 0, NULL); + NULL, 0); } } if (sub_end_index >= end_index) { diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index b5807bb377c..f6298ee2c9b 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -213,7 +213,7 @@ vbo_save_playback_vertex_list(struct gl_context *ctx, void *data) GLuint min_index = _vbo_save_get_min_index(node); GLuint max_index = _vbo_save_get_max_index(node); ctx->Driver.Draw(ctx, node->prims, node->prim_count, NULL, GL_TRUE, - min_index, max_index, NULL, 0, NULL); + min_index, max_index, NULL, 0); } } -- 2.30.2