mesa/st: drop Draw from dd function table.

Draw is only called in the feedback paths now, and the only thing
it is set to is the st feedback draw path.

So just always have the fallback call the draw feedback path and
get rid of the draw entry.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14100>
This commit is contained in:
Dave Airlie 2021-12-07 13:53:48 +10:00 committed by Marge Bot
parent 5312511ea5
commit 6d1a15f7fa
4 changed files with 8 additions and 31 deletions

View File

@ -148,26 +148,6 @@ struct dd_function_table {
* } DrawElementsIndirectCommand;
*/
/**
* Draw a number of primitives.
* \param prims array [nr_prims] describing what to draw (prim type,
* vertex count, first index, instance count, etc).
* \param ib index buffer for indexed drawing, NULL for array drawing
* \param index_bounds_valid are min_index and max_index valid?
* \param min_index lowest vertex index used
* \param max_index highest vertex index used
* \param num_instances instance count from ARB_draw_instanced
* \param base_instance base instance from ARB_base_instance
*/
void (*Draw)(struct gl_context *ctx,
const struct _mesa_prim *prims, unsigned nr_prims,
const struct _mesa_index_buffer *ib,
bool index_bounds_valid,
bool primitive_restart,
unsigned restart_index,
unsigned min_index, unsigned max_index,
unsigned num_instances, unsigned base_instance);
/**
* Optimal Gallium version of Draw() that doesn't require translation
* of draw info in the state tracker.

View File

@ -1017,10 +1017,10 @@ _mesa_draw_gallium_fallback(struct gl_context *ctx,
max_index = draws[i].start + draws[i].count - 1;
}
ctx->Driver.Draw(ctx, &prim, 1, index_size ? &ib : NULL,
index_bounds_valid, info->primitive_restart,
info->restart_index, min_index, max_index,
info->instance_count, info->start_instance);
st_feedback_draw_vbo(ctx, &prim, 1, index_size ? &ib : NULL,
index_bounds_valid, info->primitive_restart,
info->restart_index, min_index, max_index,
info->instance_count, info->start_instance);
}
return;
}
@ -1069,10 +1069,10 @@ _mesa_draw_gallium_fallback(struct gl_context *ctx,
}
if (num_prims)
ctx->Driver.Draw(ctx, prim, num_prims, index_size ? &ib : NULL,
index_bounds_valid, info->primitive_restart,
info->restart_index, min_index, max_index,
info->instance_count, info->start_instance);
st_feedback_draw_vbo(ctx, prim, num_prims, index_size ? &ib : NULL,
index_bounds_valid, info->primitive_restart,
info->restart_index, min_index, max_index,
info->instance_count, info->start_instance);
FREE_PRIMS(prim, num_draws);
}

View File

@ -292,7 +292,6 @@ st_RenderMode(struct gl_context *ctx, GLenum newMode )
st->selection_stage = draw_glselect_stage(ctx, draw);
draw_set_rasterize_stage(draw, st->selection_stage);
/* Plug in new vbo draw function */
ctx->Driver.Draw = st_feedback_draw_vbo;
ctx->Driver.DrawGallium = _mesa_draw_gallium_fallback;
ctx->Driver.DrawGalliumMultiMode = _mesa_draw_gallium_multimode_fallback;
}
@ -303,7 +302,6 @@ st_RenderMode(struct gl_context *ctx, GLenum newMode )
st->feedback_stage = draw_glfeedback_stage(ctx, draw);
draw_set_rasterize_stage(draw, st->feedback_stage);
/* Plug in new vbo draw function */
ctx->Driver.Draw = st_feedback_draw_vbo;
ctx->Driver.DrawGallium = _mesa_draw_gallium_fallback;
ctx->Driver.DrawGalliumMultiMode = _mesa_draw_gallium_multimode_fallback;
/* need to generate/use a vertex program that emits pos/color/tex */

View File

@ -372,7 +372,6 @@ void
st_init_draw_functions(struct pipe_screen *screen,
struct dd_function_table *functions)
{
functions->Draw = NULL;
functions->DrawGallium = st_draw_gallium;
functions->DrawGalliumMultiMode = st_draw_gallium_multimode;