mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-06 23:20:25 +01:00
v3dv: improve barrier handling for secondary command buffers
Use v3dv_job_apply_barrier_state to consume pending barriers when executing secondary command buffers. This ensures we only serialize against relevant stages, addressing FIXME. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39278>
This commit is contained in:
parent
de64c7238a
commit
92fc9719bb
2 changed files with 24 additions and 21 deletions
|
|
@ -2072,17 +2072,17 @@ cmd_buffer_execute_outside_pass(struct v3dv_cmd_buffer *primary,
|
|||
return;
|
||||
|
||||
if (pending_barrier.dst_mask) {
|
||||
/* FIXME: do the same we do for primaries and only choose the
|
||||
* relevant src masks.
|
||||
*/
|
||||
job->serialize = pending_barrier.src_mask_graphics |
|
||||
pending_barrier.src_mask_transfer |
|
||||
pending_barrier.src_mask_compute;
|
||||
if (pending_barrier.bcl_buffer_access ||
|
||||
pending_barrier.bcl_image_access) {
|
||||
const uint8_t prev_dst_mask = pending_barrier.dst_mask;
|
||||
v3dv_job_apply_barrier_state(job, &pending_barrier);
|
||||
|
||||
if ((prev_dst_mask & V3DV_BARRIER_GRAPHICS_BIT) &&
|
||||
!(pending_barrier.dst_mask & V3DV_BARRIER_GRAPHICS_BIT) &&
|
||||
(pending_barrier.bcl_buffer_access ||
|
||||
pending_barrier.bcl_image_access)) {
|
||||
job->needs_bcl_sync = true;
|
||||
pending_barrier.bcl_buffer_access = 0;
|
||||
pending_barrier.bcl_image_access = 0;
|
||||
}
|
||||
memset(&pending_barrier, 0, sizeof(pending_barrier));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2266,22 +2266,25 @@ v3dX(cmd_buffer_execute_inside_pass)(struct v3dv_cmd_buffer *primary,
|
|||
* primary's job list right after it.
|
||||
*/
|
||||
v3dv_cmd_buffer_finish_job(primary);
|
||||
v3dv_job_clone_in_cmd_buffer(secondary_job, primary);
|
||||
struct v3dv_job *job =
|
||||
v3dv_job_clone_in_cmd_buffer(secondary_job, primary);
|
||||
if (!job)
|
||||
return;
|
||||
|
||||
if (pending_barrier.dst_mask) {
|
||||
/* FIXME: do the same we do for primaries and only choose the
|
||||
* relevant src masks.
|
||||
*/
|
||||
secondary_job->serialize = pending_barrier.src_mask_graphics |
|
||||
pending_barrier.src_mask_transfer |
|
||||
pending_barrier.src_mask_compute;
|
||||
if (pending_barrier.bcl_buffer_access ||
|
||||
pending_barrier.bcl_image_access) {
|
||||
secondary_job->needs_bcl_sync = true;
|
||||
const uint8_t prev_dst_mask = pending_barrier.dst_mask;
|
||||
v3dv_job_apply_barrier_state(job, &pending_barrier);
|
||||
|
||||
if ((prev_dst_mask & V3DV_BARRIER_GRAPHICS_BIT) &&
|
||||
!(pending_barrier.dst_mask & V3DV_BARRIER_GRAPHICS_BIT) &&
|
||||
(pending_barrier.bcl_buffer_access ||
|
||||
pending_barrier.bcl_image_access)) {
|
||||
job->needs_bcl_sync = true;
|
||||
pending_barrier.bcl_buffer_access = 0;
|
||||
pending_barrier.bcl_image_access = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
memset(&pending_barrier, 0, sizeof(pending_barrier));
|
||||
}
|
||||
|
||||
/* If the secondary has recorded any vkCmdEndQuery commands, we need to
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue