mesa/src
Hans-Kristian Arntzen f58630f07c radv: Always allow sparse on normal GFX/COMPUTE/DMA queues.
Forcing a dedicated sparse queue is problematic in real-world scenarios.

In the current implicit sync world for sparse updates, we can rely on
submission order.

For use cases where an application can take advantage of the separate
sparse queue to do "async" updates, the existing implementation works
well, but problems arise when trying to implement D3D-style submission
ordering. E.g., when a game does sparse on a graphics or compute queue,
we need to guarantee that previous submissions, sparse update and future
submissions are properly ordered.
The Vulkan way of implementing this is to:

- Signal graphics queue to timeline N (i.e. last submission made)
- Wait on timeline N on the sparse queue
- Do sparse updates
- Signal timeline N + 1 on sparse queue
- Wait for timeline N + 1 on graphics queue (can be deferred until next
  graphics submit)

This causes an unavoidable bubble in GPU execution, since the
existing sparse queue ends up doing:

- Wait pending signal. The implication here is that all previous GPU
  work must have been submitted.
- Do VM operations on CPU timeline
- Wait for semaphores to signal (this is required for signal ordering)
- ... GPU is meanwhile stalling in a bubble due to GPU -> CPU -> GPU roundtrip.
- Signal semaphore on CPU (unblocks GPU work)

Letting the GPU go idle here is not great, and we can be screwed over by bad thread scheduling.

Another knock-on effect is that the graphics queue is now forced into
using a thread for submissions. This is because when the graphics queue
wants to wait for timeline N + 1, the sparse queue may not have
signalled the timeline yet on CPU, so effectively, we have created a
wait-before-signal situation internally in RADV. Throwing another thread
under the bus is not great either.

Just letting the queue in question support sparse binding solves all
these issues and I don't see a path forward where the D3D use case can
be solved in a separate queue world.

It is also friendlier to the ecosystem at large. RADV is the only driver
I know of that insists on separate sparse queues and multiple games
assume that graphics queue can support sparse.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33166>
2025-02-06 14:07:20 +00:00
..
amd radv: Always allow sparse on normal GFX/COMPUTE/DMA queues. 2025-02-06 14:07:20 +00:00
android_stub
asahi Revert "hk: Stop using strings or common key types for meta keys" 2025-02-05 20:01:35 +00:00
broadcom mesa: fix RGBA_SIGNED_COMPONENTS for lowered signed luminance 2025-02-05 07:41:51 +00:00
c11 c11: use SPDX-License-Identifier header 2025-01-08 20:37:51 +00:00
compiler nir: add a high precision conversion unorm->float 2025-02-06 08:20:21 +00:00
drm-shim
egl egl: never select swrast for vmwgfx 2025-01-23 21:14:21 +00:00
etnaviv etnaviv/ci: convert from baremetal to CI-Tron 2025-02-05 04:35:07 +00:00
freedreno freedreno/ci: update expectations 2025-02-06 03:31:02 +00:00
gallium ci/android: add an android-angle-lavapipe job 2025-02-06 11:58:33 +00:00
gbm egl,gallium,gbm,mesa: replace get_param with pipe_caps access 2025-01-17 04:39:46 +00:00
getopt
gfxstream gfxstream: mark unused variables as such 2025-02-05 19:28:42 +00:00
glx kopper: implement to get sync values. 2025-02-04 14:36:05 +00:00
gtest
imagination pvr: use vk_descriptor_type_is_dynamic 2024-12-19 15:12:58 +00:00
imgui
intel blorp: Enable SimpleFloatBlendEnable on Xe3+ 2025-02-05 22:27:54 -08:00
loader loader/wayland: Fix missing timespec.h include 2025-02-06 10:39:25 +01:00
mapi glapi: rename exported symbols so as not to conflict with old libglapi 2025-01-23 00:49:05 +00:00
mesa mesa: fix RGBA_SIGNED_COMPONENTS for lowered signed luminance 2025-02-05 07:41:51 +00:00
microsoft ci: fix the artifact name 2025-02-05 04:35:07 +00:00
nouveau nak: Fix cbuf textures 2025-02-05 13:02:46 +00:00
panfrost pan/ci: add a couple of common flakes 2025-02-06 13:42:44 +00:00
tool panvk: add u_trace perfetto support 2024-12-17 23:14:26 +00:00
util util/disk_cache: add a new helper to create a disk cache 2025-02-05 16:30:27 +00:00
virtio doc,src: replace doc and comments for shader and compute cap 2025-02-05 11:20:49 +08:00
vulkan vulkan/runtime: allow to use a different disk cache 2025-02-05 16:30:27 +00:00
x11 meson: require dri3 modifiers 2024-09-06 17:34:17 +00:00
.clang-format freedreno: move ForEachMacros into freedreno 2025-01-24 12:15:31 +00:00
meson.build dri: put shared-glapi into libgallium.*.so 2025-01-23 00:49:05 +00:00