diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c index 69c5a75624d..c232bf0c9c9 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c @@ -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); }