panfrost: add a barrier when launching xfb jobs in CSF

When we start writing to an XFB buffer we need to synchronize with
any batches reading from it (because the data they need is about
to be overwritten). Do this by introducing a barrier in csf_launch_xfb.

This patch fixes a valhall failure in
KHR-GLES31.core.vertex_attrib_binding.advanced-iterations

Cc: mesa-stable
Signed-off-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29092>
(cherry picked from commit eefe34127f)
This commit is contained in:
Eric R. Smith 2024-05-07 16:05:02 -03:00 committed by Eric Engestrom
parent 4757d2ccd9
commit 3198caaab7
2 changed files with 4 additions and 1 deletions

View file

@ -44,7 +44,7 @@
"description": "panfrost: add a barrier when launching xfb jobs in CSF",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -671,6 +671,9 @@ GENX(csf_launch_xfb)(struct panfrost_batch *batch,
csf_emit_shader_regs(batch, PIPE_SHADER_VERTEX,
batch->rsd[PIPE_SHADER_VERTEX]);
/* force a barrier to avoid read/write sync issues with buffers */
cs_wait_slot(b, 2, false);
/* XXX: Choose correctly */
cs_run_compute(b, 1, MALI_TASK_AXIS_Z, false, cs_shader_res_sel(0, 0, 0, 0));
}