diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c index f4ecd1b9774..0dba6c16ea0 100644 --- a/src/gallium/drivers/iris/iris_resolve.c +++ b/src/gallium/drivers/iris/iris_resolve.c @@ -413,6 +413,17 @@ iris_predraw_flush_buffers(struct iris_context *ice, if (ice->state.stage_dirty & (IRIS_STAGE_DIRTY_BINDINGS_VS << stage)) flush_ssbos(batch, shs); + + if (ice->state.streamout_active && + (ice->state.dirty & IRIS_DIRTY_SO_BUFFERS)) { + for (int i = 0; i < 4; i++) { + struct iris_stream_output_target *tgt = (void *)ice->state.so_target[i]; + if (tgt) { + struct iris_bo *bo = iris_resource_bo(tgt->base.buffer); + iris_emit_buffer_barrier_for(batch, bo, IRIS_DOMAIN_OTHER_WRITE); + } + } + } } static void diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index bd39845a3e7..a690c2bec0e 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -2544,6 +2544,9 @@ iris_dirty_for_history(struct iris_context *ice, if (res->bind_history & PIPE_BIND_VERTEX_BUFFER) dirty |= IRIS_DIRTY_VERTEX_BUFFER_FLUSHES; + if (ice->state.streamout_active && (res->bind_history & PIPE_BIND_STREAM_OUTPUT)) + dirty |= IRIS_DIRTY_SO_BUFFERS; + ice->state.dirty |= dirty; ice->state.stage_dirty |= stage_dirty; }