mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 21:20:12 +01:00
iris: Insert buffer-local memory barriers for SSBO reads and writes.
Similar to what was previously done for vertex buffers, render buffers, etc -- Insert memory barriers at resolves-and-flushes time instead of relying on the history flush mechanism. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12691>
This commit is contained in:
parent
8e49d4809e
commit
077af5c928
2 changed files with 17 additions and 0 deletions
|
|
@ -152,6 +152,20 @@ resolve_image_views(struct iris_context *ice,
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
flush_ssbos(struct iris_batch *batch,
|
||||
struct iris_shader_state *shs)
|
||||
{
|
||||
uint32_t ssbos = shs->bound_ssbos;
|
||||
|
||||
while (ssbos) {
|
||||
const int i = u_bit_scan(&ssbos);
|
||||
struct pipe_shader_buffer *ssbo = &shs->ssbo[i];
|
||||
struct iris_resource *res = (void *)ssbo->buffer;
|
||||
iris_emit_buffer_barrier_for(batch, res->bo, IRIS_DOMAIN_DATA_WRITE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Resolve buffers before drawing.
|
||||
*
|
||||
|
|
@ -176,6 +190,7 @@ iris_predraw_resolve_inputs(struct iris_context *ice,
|
|||
consider_framebuffer);
|
||||
resolve_image_views(ice, batch, shs, info, draw_aux_buffer_disabled,
|
||||
consider_framebuffer);
|
||||
flush_ssbos(batch, shs);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3400,6 +3400,8 @@ iris_set_shader_buffers(struct pipe_context *ctx,
|
|||
}
|
||||
}
|
||||
|
||||
ice->state.dirty |= (IRIS_DIRTY_RENDER_RESOLVES_AND_FLUSHES |
|
||||
IRIS_DIRTY_COMPUTE_RESOLVES_AND_FLUSHES);
|
||||
ice->state.stage_dirty |= IRIS_STAGE_DIRTY_BINDINGS_VS << stage;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue