radv: use vk_drm_syncobj_copy_payloads
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Based on a patch by llyyr <llyyr.public@gmail.com>:

!36827 added the copy_sync_payloads function, but didn't enable use of
it in radv. This commit mirrors similar MRs for anv/panvk/nvk and uses
the common vk_drm_syncobj_copy_payloads function for copy_sync_payloads.

I'm not too familiar with radv internals, so there's potentially a good
reason why this isn't a good change. However, I've personally been using
this patch locally for around a month and have experienced no
regressions and around 8% uplift on vkmark test scores with a 6600 XT.

[vertex] device-local=true: 45110 -> 48489 (+7.5%)
[vertex] device-local=false: 17529 -> 17488 (-0.2%)
[texture] anisotropy=0: 44768 -> 48679 (+8.7%)
[texture] anisotropy=16: 44920 -> 48572 (+8.1%)
[shading] shading=gouraud: 44931 -> 48467 (+7.9%)
[shading] shading=blinn-phong-inf: 44849 -> 48740 (+8.7%)
[shading] shading=phong: 44695 -> 48645 (+8.8%)
[shading] shading=cel: 44809 -> 47938 (+7.0%)
[effect2d] kernel=edge: 45185 -> 47837 (+5.9%)
[effect2d] kernel=blur: 26919 -> 26762 (-0.6%)
[desktop] <default>: 40974 -> 44034 (+7.5%)
[cube] <default>: 45090 -> 49270 (+9.3%)
[clear] <default>: 41102 -> 44375 (+8.0%)

(https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37606)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37640>
This commit is contained in:
Bas Nieuwenhuizen 2025-09-30 17:31:05 +02:00 committed by Marge Bot
parent b0d2d4537f
commit 82d06b58ad
3 changed files with 10 additions and 0 deletions

View file

@ -1195,6 +1195,7 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr
device->ws = pdev->ws; device->ws = pdev->ws;
device->vk.sync = device->ws->get_sync_provider(device->ws); device->vk.sync = device->ws->get_sync_provider(device->ws);
device->vk.copy_sync_payloads = pdev->ws->copy_sync_payloads;
/* With update after bind we can't attach bo's to the command buffer /* With update after bind we can't attach bo's to the command buffer
* from the descriptor set anymore, so we have to use a global BO list. * from the descriptor set anymore, so we have to use a global BO list.

View file

@ -23,6 +23,7 @@
#include "amd_family.h" #include "amd_family.h"
struct radeon_info; struct radeon_info;
struct vk_device;
struct vk_sync_type; struct vk_sync_type;
struct vk_sync_wait; struct vk_sync_wait;
struct vk_sync_signal; struct vk_sync_signal;
@ -321,6 +322,13 @@ struct radeon_winsys {
const struct vk_sync_type *const *(*get_sync_types)(struct radeon_winsys *ws); const struct vk_sync_type *const *(*get_sync_types)(struct radeon_winsys *ws);
struct util_sync_provider *(*get_sync_provider)(struct radeon_winsys *ws); struct util_sync_provider *(*get_sync_provider)(struct radeon_winsys *ws);
VkResult (*copy_sync_payloads)(struct vk_device *device,
uint32_t wait_count,
const struct vk_sync_wait *waits,
uint32_t signal_count,
const struct vk_sync_signal *signals);
}; };
static inline uint64_t static inline uint64_t

View file

@ -340,6 +340,7 @@ radv_amdgpu_winsys_create(int fd, uint64_t debug_flags, uint64_t perftest_flags,
ws->base.get_fd = radv_amdgpu_winsys_get_fd; ws->base.get_fd = radv_amdgpu_winsys_get_fd;
ws->base.get_sync_types = radv_amdgpu_winsys_get_sync_types; ws->base.get_sync_types = radv_amdgpu_winsys_get_sync_types;
ws->base.get_sync_provider = radv_amdgpu_winsys_get_sync_provider; ws->base.get_sync_provider = radv_amdgpu_winsys_get_sync_provider;
ws->base.copy_sync_payloads = vk_drm_syncobj_copy_payloads;
radv_amdgpu_bo_init_functions(ws); radv_amdgpu_bo_init_functions(ws);
radv_amdgpu_cs_init_functions(ws); radv_amdgpu_cs_init_functions(ws);