Mesa (master): radv: Add a trivial implementation of VK_KHR_deferred_host_operation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 19 00:53:20 UTC 2021


Module: Mesa
Branch: master
Commit: c4ea4e026be777a91d34666a16204fc003ce6a14
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c4ea4e026be777a91d34666a16204fc003ce6a14

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Sun Jan 17 13:37:50 2021 +0100

radv: Add a trivial implementation of VK_KHR_deferred_host_operation

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8545>

---

 src/amd/vulkan/radv_device.c      | 40 +++++++++++++++++++++++++++++++++++++++
 src/amd/vulkan/radv_extensions.py |  1 +
 2 files changed, 41 insertions(+)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 7c10d24ed7d..2344bb73594 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -38,6 +38,7 @@
 #include "radv_shader.h"
 #include "radv_cs.h"
 #include "util/disk_cache.h"
+#include "vk_deferred_operation.h"
 #include "vk_util.h"
 #include <xf86drm.h>
 #include <amdgpu.h>
@@ -8363,3 +8364,42 @@ void radv_GetPrivateDataEXT(
 	vk_object_base_get_private_data(&device->vk, objectType, objectHandle,
 					privateDataSlot, pData);
 }
+
+VkResult radv_CreateDeferredOperationKHR(VkDevice _device,
+                                         const VkAllocationCallbacks* pAllocator,
+                                         VkDeferredOperationKHR* pDeferredOperation)
+{
+	RADV_FROM_HANDLE(radv_device, device, _device);
+	return vk_create_deferred_operation(&device->vk, pAllocator,
+	                                    pDeferredOperation);
+}
+
+void radv_DestroyDeferredOperationKHR(VkDevice _device,
+                                      VkDeferredOperationKHR operation,
+                                      const VkAllocationCallbacks* pAllocator)
+{
+	RADV_FROM_HANDLE(radv_device, device, _device);
+	vk_destroy_deferred_operation(&device->vk, operation, pAllocator);
+}
+
+uint32_t radv_GetDeferredOperationMaxConcurrencyKHR(VkDevice _device,
+                                                    VkDeferredOperationKHR operation)
+{
+	RADV_FROM_HANDLE(radv_device, device, _device);
+	return vk_get_deferred_operation_max_concurrency(&device->vk, operation);
+}
+
+VkResult radv_GetDeferredOperationResultKHR(VkDevice _device,
+                                            VkDeferredOperationKHR operation)
+{
+	RADV_FROM_HANDLE(radv_device, device, _device);
+	return vk_get_deferred_operation_result(&device->vk, operation);
+}
+
+VkResult radv_DeferredOperationJoinKHR(VkDevice _device,
+                                       VkDeferredOperationKHR operation)
+{
+	RADV_FROM_HANDLE(radv_device, device, _device);
+	return vk_deferred_operation_join(&device->vk, operation);
+}
+
diff --git a/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py
index 8452935e262..30e88c2dc74 100644
--- a/src/amd/vulkan/radv_extensions.py
+++ b/src/amd/vulkan/radv_extensions.py
@@ -62,6 +62,7 @@ EXTENSIONS = [
     Extension('VK_KHR_copy_commands2',                    1, True),
     Extension('VK_KHR_create_renderpass2',                1, True),
     Extension('VK_KHR_dedicated_allocation',              3, True),
+    Extension('VK_KHR_deferred_host_operations',          1, True),
     Extension('VK_KHR_depth_stencil_resolve',             1, True),
     Extension('VK_KHR_descriptor_update_template',        1, True),
     Extension('VK_KHR_device_group',                      4, True),



More information about the mesa-commit mailing list