From 217874507b4b3629324987279befc8612b5f7132 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 25 Aug 2023 04:57:53 +0100 Subject: [PATCH] a/vk: Re-order functions [NFC] --- src/xrt/auxiliary/vk/vk_helpers.c | 82 +++++++++++++++---------------- src/xrt/auxiliary/vk/vk_helpers.h | 4 +- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/xrt/auxiliary/vk/vk_helpers.c b/src/xrt/auxiliary/vk/vk_helpers.c index df4433461..3a80c7edf 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.c +++ b/src/xrt/auxiliary/vk/vk_helpers.c @@ -429,36 +429,6 @@ vk_sharing_mode_string(VkSharingMode code) } } -XRT_CHECK_RESULT const char * -vk_format_feature_string(VkFormatFeatureFlagBits code) -{ - switch (code) { - ENUM_TO_STR(VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT); - ENUM_TO_STR(VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT); - ENUM_TO_STR(VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT); - ENUM_TO_STR(VK_FORMAT_FEATURE_TRANSFER_SRC_BIT); - ENUM_TO_STR(VK_FORMAT_FEATURE_TRANSFER_DST_BIT); - ENUM_TO_STR(VK_FORMAT_R5G6B5_UNORM_PACK16); - default: return "UNKNOWN FORMAT FEATURE"; - } -} - -XRT_CHECK_RESULT const char * -xrt_swapchain_usage_string(enum xrt_swapchain_usage_bits code) -{ - switch (code) { - ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_COLOR); - ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_DEPTH_STENCIL); - ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_UNORDERED_ACCESS); - ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_TRANSFER_SRC); - ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_TRANSFER_DST); - ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_SAMPLED); - ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_MUTABLE_FORMAT); - ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_INPUT_ATTACHMENT); - default: return "UNKNOWN SWAPCHAIN USAGE"; - } -} - XRT_CHECK_RESULT const char * vk_present_mode_string(VkPresentModeKHR code) { @@ -473,17 +443,6 @@ vk_present_mode_string(VkPresentModeKHR code) } } -XRT_CHECK_RESULT const char * -vk_power_state_string(VkDisplayPowerStateEXT code) -{ - switch (code) { - ENUM_TO_STR(VK_DISPLAY_POWER_STATE_OFF_EXT); - ENUM_TO_STR(VK_DISPLAY_POWER_STATE_SUSPEND_EXT); - ENUM_TO_STR(VK_DISPLAY_POWER_STATE_ON_EXT); - default: return "UNKNOWN MODE"; - } -} - XRT_CHECK_RESULT const char * vk_color_space_string(VkColorSpaceKHR code) { @@ -512,6 +471,47 @@ vk_color_space_string(VkColorSpaceKHR code) } } +XRT_CHECK_RESULT const char * +vk_power_state_string(VkDisplayPowerStateEXT code) +{ + switch (code) { + ENUM_TO_STR(VK_DISPLAY_POWER_STATE_OFF_EXT); + ENUM_TO_STR(VK_DISPLAY_POWER_STATE_SUSPEND_EXT); + ENUM_TO_STR(VK_DISPLAY_POWER_STATE_ON_EXT); + default: return "UNKNOWN MODE"; + } +} + +XRT_CHECK_RESULT const char * +vk_format_feature_string(VkFormatFeatureFlagBits code) +{ + switch (code) { + ENUM_TO_STR(VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT); + ENUM_TO_STR(VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT); + ENUM_TO_STR(VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT); + ENUM_TO_STR(VK_FORMAT_FEATURE_TRANSFER_SRC_BIT); + ENUM_TO_STR(VK_FORMAT_FEATURE_TRANSFER_DST_BIT); + ENUM_TO_STR(VK_FORMAT_R5G6B5_UNORM_PACK16); + default: return "UNKNOWN FORMAT FEATURE"; + } +} + +XRT_CHECK_RESULT const char * +xrt_swapchain_usage_string(enum xrt_swapchain_usage_bits code) +{ + switch (code) { + ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_COLOR); + ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_DEPTH_STENCIL); + ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_UNORDERED_ACCESS); + ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_TRANSFER_SRC); + ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_TRANSFER_DST); + ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_SAMPLED); + ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_MUTABLE_FORMAT); + ENUM_TO_STR(XRT_SWAPCHAIN_USAGE_INPUT_ATTACHMENT); + default: return "UNKNOWN SWAPCHAIN USAGE"; + } +} + XRT_CHECK_RESULT bool vk_has_error(VkResult res, const char *fun, const char *file, int line) { diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h index 510116f40..1ab6ae724 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.h +++ b/src/xrt/auxiliary/vk/vk_helpers.h @@ -456,10 +456,10 @@ XRT_CHECK_RESULT const char * vk_present_mode_string(VkPresentModeKHR code); XRT_CHECK_RESULT const char * -vk_power_state_string(VkDisplayPowerStateEXT code); +vk_color_space_string(VkColorSpaceKHR code); XRT_CHECK_RESULT const char * -vk_color_space_string(VkColorSpaceKHR code); +vk_power_state_string(VkDisplayPowerStateEXT code); XRT_CHECK_RESULT const char * vk_format_feature_string(VkFormatFeatureFlagBits code);