From ccf232d4acdcbb14ceb10eff800faba65c253a7a Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 29 Aug 2023 18:58:16 +0100 Subject: [PATCH] a/vk: Add vk_physical_device_type_string --- src/xrt/auxiliary/vk/vk_helpers.c | 12 ++++++++++++ src/xrt/auxiliary/vk/vk_helpers.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/src/xrt/auxiliary/vk/vk_helpers.c b/src/xrt/auxiliary/vk/vk_helpers.c index e85f493ab..8ca3f7399 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.c +++ b/src/xrt/auxiliary/vk/vk_helpers.c @@ -160,6 +160,18 @@ vk_result_string(VkResult code) } } +XRT_CHECK_RESULT const char * +vk_physical_device_type_string(VkPhysicalDeviceType device_type) +{ + switch (device_type) { + ENUM_TO_STR(VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU); + ENUM_TO_STR(VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU); + ENUM_TO_STR(VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU); + ENUM_TO_STR(VK_PHYSICAL_DEVICE_TYPE_CPU); + default: return "UNKNOWN PHYSICAL DEVICE TYPE"; + } +} + XRT_CHECK_RESULT const char * vk_format_string(VkFormat code) { diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h index ff933f5c9..63f539b35 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.h +++ b/src/xrt/auxiliary/vk/vk_helpers.h @@ -446,6 +446,9 @@ struct vk_buffer XRT_CHECK_RESULT const char * vk_result_string(VkResult code); +XRT_CHECK_RESULT const char * +vk_physical_device_type_string(VkPhysicalDeviceType device_type); + XRT_CHECK_RESULT const char * vk_format_string(VkFormat code);