mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 17:58:26 +02:00
iris: Add pre-draw flushing for stream output targets
When stream output is active, we need to let the cache tracker know
about any SO buffers, which we access via IRIS_DOMAIN_OTHER_WRITE.
In particular, we may have written to those buffers via another
mechanism, such as BLORP buffer copies. In that case, previous writes
happened via IRIS_DOMAIN_RENDER_WRITE, in which case we'd need to flush
both the render cache and the tile cache to make that data globally-
observable before we begin writing via streamout, which is incoherent
with the earlier mechanism.
Fixes misrendering in Ryujinx.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6085
Fixes: d8cb76211c ("iris: Fix MOCS for buffer copies")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15275>
This commit is contained in:
parent
43e3747eea
commit
9c8874b9ab
2 changed files with 14 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue