diff options
author | Jason Ekstrand <[email protected]> | 2015-07-14 16:11:21 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-07-14 16:11:21 -0700 |
commit | 02db21ae1188dd1e28efc8045de095be3e214bc8 (patch) | |
tree | 4fe466e245d04c2da5fe1406f31bf8548c2b07b8 /src | |
parent | a463eacb8f811ba8c820fcd53ae82f22ac0a3eff (diff) |
vk: Add the new extension/layer enumeration entrypoints
Diffstat (limited to 'src')
-rw-r--r-- | src/vulkan/device.c | 69 |
1 files changed, 39 insertions, 30 deletions
diff --git a/src/vulkan/device.c b/src/vulkan/device.c index d566bb0b092..752b7813396 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -643,59 +643,68 @@ VkResult anv_DestroyDevice( static const VkExtensionProperties global_extensions[] = { { .extName = "VK_WSI_LunarG", - .version = 3 + .specVersion = 3 } }; -VkResult anv_GetGlobalExtensionCount( - uint32_t* pCount) -{ - *pCount = ARRAY_SIZE(global_extensions); - - return VK_SUCCESS; -} - - VkResult anv_GetGlobalExtensionProperties( - uint32_t extensionIndex, + const char* pLayerName, + uint32_t* pCount, VkExtensionProperties* pProperties) { - assert(extensionIndex < ARRAY_SIZE(global_extensions)); - - *pProperties = global_extensions[extensionIndex]; + if (pProperties == NULL) { + *pCount = ARRAY_SIZE(global_extensions); + return VK_SUCCESS; + } - return VK_SUCCESS; -} + assert(*pCount < ARRAY_SIZE(global_extensions)); -VkResult anv_GetPhysicalDeviceExtensionCount( - VkPhysicalDevice physicalDevice, - uint32_t* pCount) -{ - /* None supported at this time */ - *pCount = 0; + *pCount = ARRAY_SIZE(global_extensions); + memcpy(pProperties, global_extensions, sizeof(global_extensions)); return VK_SUCCESS; } VkResult anv_GetPhysicalDeviceExtensionProperties( VkPhysicalDevice physicalDevice, - uint32_t extensionIndex, + const char* pLayerName, + uint32_t* pCount, VkExtensionProperties* pProperties) { + if (pProperties == NULL) { + *pCount = 0; + return VK_SUCCESS; + } + /* None supported at this time */ return vk_error(VK_ERROR_INVALID_EXTENSION); } -VkResult anv_EnumerateLayers( +VkResult anv_GetGlobalLayerProperties( + uint32_t* pCount, + VkLayerProperties* pProperties) +{ + if (pProperties == NULL) { + *pCount = 0; + return VK_SUCCESS; + } + + /* None supported at this time */ + return vk_error(VK_ERROR_INVALID_LAYER); +} + +VkResult anv_GetPhysicalDeviceLayerProperties( VkPhysicalDevice physicalDevice, - size_t maxStringSize, - size_t* pLayerCount, - char* const* pOutLayers, - void* pReserved) + uint32_t* pCount, + VkLayerProperties* pProperties) { - *pLayerCount = 0; + if (pProperties == NULL) { + *pCount = 0; + return VK_SUCCESS; + } - return VK_SUCCESS; + /* None supported at this time */ + return vk_error(VK_ERROR_INVALID_LAYER); } VkResult anv_GetDeviceQueue( |