v3d: Sync on last CS when non-compute stage uses resource written by CS
v3d: Sync on last CS when non-compute stage uses resource written by CS
When a resource is written by a compute shader and then used by a non-compute stage we sync on last compute job to guarantee that the resource has been completely written when the next stage process with the read.
In the other cases how flushes are done guarantee the serialization of the writes and reads.
To reproduce the failure the following tests should be executed in batch as last test don't fail when run isolated:
KHR-GLES31.core.shader_image_load_store.basic-allFormats-load-fs KHR-GLES31.core.shader_image_load_store.basic-allFormats-loadStoreComputeStage KHR-GLES31.core.shader_image_load_store.basic-allTargets-load-cs KHR-GLES31.core.shader_image_load_store.advanced-sync-vertexArray
v2: Use fence dep instead of bo_wait (Eric Anholt)
Fixes: KHR-GLES31.core.shader_image_load_store.advanced-sync-vertexArray
Cc: 19.3 20.0 mesa-stable@lists.freedesktop.org