From 736f1fd671d6e9eb99602a05de84b29ef03ff08b Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 3 Nov 2022 17:50:58 +0000 Subject: [PATCH] c/util: Slightly improve device and queue creation --- src/xrt/compositor/util/comp_vulkan.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/xrt/compositor/util/comp_vulkan.c b/src/xrt/compositor/util/comp_vulkan.c index 093af0967..33bbde4cb 100644 --- a/src/xrt/compositor/util/comp_vulkan.c +++ b/src/xrt/compositor/util/comp_vulkan.c @@ -211,9 +211,9 @@ create_device(struct vk_bundle *vk, const struct comp_vulkan_arguments *vk_args) VkResult ret; const char *prio_strs[3] = { - "realtime", - "high", - "normal", + "QUEUE_GLOBAL_PRIORITY_REALTIME", + "QUEUE_GLOBAL_PRIORITY_HIGH", + "QUEUE_GLOBAL_PRIORITY_MEDIUM", }; VkQueueGlobalPriorityEXT prios[3] = { @@ -243,8 +243,8 @@ create_device(struct vk_bundle *vk, const struct comp_vulkan_arguments *vk_args) // All ok! if (ret == VK_SUCCESS) { - VK_INFO(vk, "Created device and %s queue with %s priority.", - only_compute_queue ? "compute" : "graphics", prio_strs[i]); + VK_INFO(vk, "Created device and %s queue with %s.", only_compute_queue ? "COMPUTE" : "GRAPHICS", + prio_strs[i]); break; } @@ -258,6 +258,12 @@ create_device(struct vk_bundle *vk, const struct comp_vulkan_arguments *vk_args) return ret; } + // All tries failed, return error. Yes this code is clunky. + if (ret != VK_SUCCESS) { + VK_ERROR_RET(vk, "vk_create_device", "Failed to create Vulkan device.", ret); + return ret; + } + ret = vk_init_mutex(vk); if (ret != VK_SUCCESS) { VK_ERROR_RET(vk, "vk_init_mutex", "Failed to init mutex.", ret);