freedreno: Move num_vertices calc to backend

Only used by a2xx and a3xx backends, so move it there.

Also make it more clear that fd6_emit::draw is only used in the
driver-params case.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
This commit is contained in:
Rob Clark 2023-02-05 11:34:37 -08:00 committed by Marge Bot
parent b15aaea1d5
commit 918caaad59
4 changed files with 8 additions and 4 deletions

View file

@ -223,6 +223,8 @@ fd2_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *pinfo,
fd_context_all_clean(ctx);
ctx->batch->num_vertices += pdraw->count * pinfo->instance_count;
return true;
}

View file

@ -160,6 +160,8 @@ fd3_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
fd_context_all_clean(ctx);
ctx->batch->num_vertices += draw->count * info->instance_count;
return true;
}

View file

@ -195,7 +195,7 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
emit.ctx = ctx;
emit.info = info;
emit.indirect = indirect;
emit.draw = draw;
emit.draw = NULL;
emit.rasterflat = ctx->rasterizer->flatshade;
emit.sprite_coord_enable = ctx->rasterizer->sprite_coord_enable;
emit.sprite_coord_mode = ctx->rasterizer->sprite_coord_mode;
@ -239,8 +239,10 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
emit.gs = fd6_emit_get_prog(&emit)->gs;
emit.fs = fd6_emit_get_prog(&emit)->fs;
if (emit.prog->num_driver_params || fd6_ctx->has_dp_state)
if (emit.prog->num_driver_params || fd6_ctx->has_dp_state) {
emit.draw = draw;
emit.dirty_groups |= BIT(FD6_GROUP_DRIVER_PARAMS);
}
/* If we are doing xfb, we need to emit the xfb state on every draw: */
if (emit.prog->stream_output)

View file

@ -355,8 +355,6 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info,
for (unsigned i = 0; i < num_draws; i++) {
ctx->draw_vbo(ctx, info, drawid_offset, indirect, &draws[i], index_offset);
batch->num_vertices += draws[i].count * info->instance_count;
}
if (unlikely(ctx->stats_users > 0))