freedreno/a6xx: Split out flush_streamout() helper

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
This commit is contained in:
Rob Clark 2023-02-05 12:10:10 -08:00 committed by Marge Bot
parent 911d67bdad
commit cc31997f1b

View file

@ -182,6 +182,22 @@ get_program_state(struct fd_context *ctx, const struct pipe_draw_info *info)
return fd6_ctx->prog;
}
static void
flush_streamout(struct fd_context *ctx, struct fd6_emit *emit)
assert_dt
{
if (!emit->streamout_mask)
return;
struct fd_ringbuffer *ring = ctx->batch->draw;
for (unsigned i = 0; i < PIPE_MAX_SO_BUFFERS; i++) {
if (emit->streamout_mask & (1 << i)) {
fd6_event_write(ctx->batch, ring, FLUSH_SO_0 + i, false);
}
}
}
static void
fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
unsigned drawid_offset,
@ -347,15 +363,7 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
emit_marker6(ring, 7);
fd_reset_wfi(ctx->batch);
if (emit.streamout_mask) {
struct fd_ringbuffer *ring = ctx->batch->draw;
for (unsigned i = 0; i < PIPE_MAX_SO_BUFFERS; i++) {
if (emit.streamout_mask & (1 << i)) {
fd6_event_write(ctx->batch, ring, FLUSH_SO_0 + i, false);
}
}
}
flush_streamout(ctx, &emit);
fd_context_all_clean(ctx);
}