freedreno: Push multi-draw closer to backend
It will take some more extensive work to plumb this through the backends (although that should increase the benefit further), but this is already worth a nearly 4x speedup in piglit drawoverhead tests with no state change, so this seems like a useful intermediate step. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
This commit is contained in:
parent
68e752652c
commit
03cf083dba
|
@ -262,11 +262,6 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info,
|
||||||
unsigned num_draws)
|
unsigned num_draws)
|
||||||
in_dt
|
in_dt
|
||||||
{
|
{
|
||||||
if (num_draws > 1) {
|
|
||||||
util_draw_multi(pctx, info, indirect, draws, num_draws);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct fd_context *ctx = fd_context(pctx);
|
struct fd_context *ctx = fd_context(pctx);
|
||||||
|
|
||||||
/* for debugging problems with indirect draw, it is convenient
|
/* for debugging problems with indirect draw, it is convenient
|
||||||
|
@ -370,10 +365,12 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info,
|
||||||
util_format_short_name(pipe_surface_format(pfb->cbufs[0])),
|
util_format_short_name(pipe_surface_format(pfb->cbufs[0])),
|
||||||
util_format_short_name(pipe_surface_format(pfb->zsbuf)));
|
util_format_short_name(pipe_surface_format(pfb->zsbuf)));
|
||||||
|
|
||||||
if (ctx->draw_vbo(ctx, info, indirect, &draws[0], index_offset))
|
for (unsigned i = 0; i < num_draws; i++) {
|
||||||
|
if (ctx->draw_vbo(ctx, info, indirect, &draws[i], index_offset))
|
||||||
batch->needs_flush = true;
|
batch->needs_flush = true;
|
||||||
|
|
||||||
batch->num_vertices += draws[0].count * info->instance_count;
|
batch->num_vertices += draws[i].count * info->instance_count;
|
||||||
|
}
|
||||||
|
|
||||||
for (unsigned i = 0; i < ctx->streamout.num_targets; i++) {
|
for (unsigned i = 0; i < ctx->streamout.num_targets; i++) {
|
||||||
assert(num_draws == 1);
|
assert(num_draws == 1);
|
||||||
|
|
Loading…
Reference in New Issue