Mesa (main): radv: Add function to allow WSI signalling fences/semaphores.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Dec 31 15:40:22 UTC 2021


Module: Mesa
Branch: main
Commit: 1965872b417deaee84b12be6862065e7a5965819
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1965872b417deaee84b12be6862065e7a5965819

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Thu Dec 30 16:03:37 2021 +0100

radv: Add function to allow WSI signalling fences/semaphores.

Added but not enabled yet. Will enable in the big switchover.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13974>

---

 src/amd/vulkan/radv_device.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 633bb2ea8ab..79313bd16d5 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -61,6 +61,8 @@ typedef void *drmDevicePtr;
 #include "git_sha1.h"
 #include "sid.h"
 #include "vk_format.h"
+#include "vk_sync.h"
+#include "vk_sync_dummy.h"
 #include "vulkan/vk_icd.h"
 
 #ifdef LLVM_AVAILABLE
@@ -2959,6 +2961,15 @@ radv_device_finish_vrs_image(struct radv_device *device)
                      &device->meta_state.alloc);
 }
 
+static VkResult
+radv_create_sync_for_memory(struct vk_device *device,
+                           VkDeviceMemory memory,
+                           bool signal_memory,
+                           struct vk_sync **sync_out)
+{
+   return vk_sync_create(device, &vk_sync_dummy_type, 0, 1, sync_out);
+}
+
 VKAPI_ATTR VkResult VKAPI_CALL
 radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo,
                   const VkAllocationCallbacks *pAllocator, VkDevice *pDevice)
@@ -3074,6 +3085,7 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr
    device->physical_device = physical_device;
 
    device->ws = physical_device->ws;
+   device->vk.create_sync_for_memory = radv_create_sync_for_memory;
    vk_device_set_drm_fd(&device->vk, device->ws->get_fd(device->ws));
 
    keep_shader_info = device->vk.enabled_extensions.AMD_shader_info;



More information about the mesa-commit mailing list