From 1cdb908074c4f2b28aff578f8b170a194a748c90 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 16 May 2016 08:58:07 +0800 Subject: [PATCH] threading: move vkEnumerate*Properties around Move them toward the end of the file. --- layers/threading.cpp | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/layers/threading.cpp b/layers/threading.cpp index 4d9fca0..454b9c4 100644 --- a/layers/threading.cpp +++ b/layers/threading.cpp @@ -159,27 +159,26 @@ VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDevice(VkDevice device, cons static const VkExtensionProperties threading_extensions[] = { {VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION}}; -VK_LAYER_EXPORT VkResult VKAPI_CALL -vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pCount, VkExtensionProperties *pProperties) { - return util_GetExtensionProperties(ARRAY_SIZE(threading_extensions), threading_extensions, pCount, pProperties); -} - static const VkLayerProperties globalLayerProps[] = {{ "VK_LAYER_GOOGLE_threading", VK_LAYER_API_VERSION, // specVersion 1, "Google Validation Layer", }}; -VK_LAYER_EXPORT VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t *pCount, VkLayerProperties *pProperties) { - return util_GetLayerProperties(ARRAY_SIZE(globalLayerProps), globalLayerProps, pCount, pProperties); -} - static const VkLayerProperties deviceLayerProps[] = {{ "VK_LAYER_GOOGLE_threading", VK_LAYER_API_VERSION, // specVersion 1, "Google Validation Layer", }}; +static inline PFN_vkVoidFunction layer_intercept_proc(const char *name) { + for (int i = 0; i < sizeof(procmap) / sizeof(procmap[0]); i++) { + if (!strcmp(name, procmap[i].name)) + return procmap[i].pFunc; + } + return NULL; +} + VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pCount, VkExtensionProperties *pProperties) { @@ -193,19 +192,6 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionPropert } } -VK_LAYER_EXPORT VkResult VKAPI_CALL -vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pCount, VkLayerProperties *pProperties) { - return util_GetLayerProperties(ARRAY_SIZE(deviceLayerProps), deviceLayerProps, pCount, pProperties); -} - -static inline PFN_vkVoidFunction layer_intercept_proc(const char *name) { - for (int i = 0; i < sizeof(procmap) / sizeof(procmap[0]); i++) { - if (!strcmp(name, procmap[i].name)) - return procmap[i].pFunc; - } - return NULL; -} - static inline PFN_vkVoidFunction layer_intercept_instance_proc(const char *name) { if (!name || name[0] != 'v' || name[1] != 'k') return NULL; @@ -346,3 +332,17 @@ void VKAPI_CALL vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, command_pool_map.erase(pCommandBuffers[index]); } } + +VK_LAYER_EXPORT VkResult VKAPI_CALL +vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pCount, VkExtensionProperties *pProperties) { + return util_GetExtensionProperties(ARRAY_SIZE(threading_extensions), threading_extensions, pCount, pProperties); +} + +VK_LAYER_EXPORT VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t *pCount, VkLayerProperties *pProperties) { + return util_GetLayerProperties(ARRAY_SIZE(globalLayerProps), globalLayerProps, pCount, pProperties); +} + +VK_LAYER_EXPORT VkResult VKAPI_CALL +vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pCount, VkLayerProperties *pProperties) { + return util_GetLayerProperties(ARRAY_SIZE(deviceLayerProps), deviceLayerProps, pCount, pProperties); +} -- 2.7.4