Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1 | // Copyright 2018 The SwiftShader Authors. All Rights Reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 15 | #include "VkBuffer.hpp" |
| 16 | #include "VkBufferView.hpp" |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 17 | #include "VkCommandBuffer.hpp" |
Alexis Hetu | 9c4ecae | 2018-11-20 16:26:10 -0500 | [diff] [blame] | 18 | #include "VkCommandPool.hpp" |
Alexis Hetu | 000df8b | 2018-10-24 15:22:41 -0400 | [diff] [blame] | 19 | #include "VkConfig.h" |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 20 | #include "VkDebug.hpp" |
Alexis Hetu | c817663 | 2019-01-22 17:01:28 -0500 | [diff] [blame] | 21 | #include "VkDescriptorPool.hpp" |
| 22 | #include "VkDescriptorSetLayout.hpp" |
Alexis Hetu | f705cec | 2019-01-29 14:09:36 -0500 | [diff] [blame] | 23 | #include "VkDescriptorUpdateTemplate.hpp" |
Alexis Hetu | e70c351 | 2018-10-17 13:18:04 -0400 | [diff] [blame] | 24 | #include "VkDestroy.h" |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 25 | #include "VkDevice.hpp" |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 26 | #include "VkDeviceMemory.hpp" |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 27 | #include "VkEvent.hpp" |
| 28 | #include "VkFence.hpp" |
Alexis Hetu | 8f631c8 | 2018-11-15 15:11:36 -0500 | [diff] [blame] | 29 | #include "VkFramebuffer.hpp" |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 30 | #include "VkGetProcAddress.h" |
Alexis Hetu | f62f375 | 2018-11-15 14:51:15 -0500 | [diff] [blame] | 31 | #include "VkImage.hpp" |
Alexis Hetu | 9fbaf69 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 32 | #include "VkImageView.hpp" |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 33 | #include "VkInstance.hpp" |
| 34 | #include "VkPhysicalDevice.hpp" |
Alexis Hetu | 000df8b | 2018-10-24 15:22:41 -0400 | [diff] [blame] | 35 | #include "VkPipeline.hpp" |
Alexis Hetu | 18a8425 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 36 | #include "VkPipelineCache.hpp" |
Alexis Hetu | 000df8b | 2018-10-24 15:22:41 -0400 | [diff] [blame] | 37 | #include "VkPipelineLayout.hpp" |
Alexis Hetu | 86f8bdb | 2019-01-22 12:07:24 -0500 | [diff] [blame] | 38 | #include "VkQueryPool.hpp" |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 39 | #include "VkQueue.hpp" |
Alexis Hetu | 5174c57 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 40 | #include "VkSampler.hpp" |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 41 | #include "VkSemaphore.hpp" |
Alexis Hetu | 259ad3d | 2018-11-15 13:44:31 -0500 | [diff] [blame] | 42 | #include "VkShaderModule.hpp" |
Alexis Hetu | b16f989 | 2018-11-15 15:18:41 -0500 | [diff] [blame] | 43 | #include "VkRenderPass.hpp" |
Nicolas Capens | 50b1059 | 2018-10-26 10:34:20 -0400 | [diff] [blame] | 44 | |
Hernan Liatis | c6eb41b | 2019-02-22 11:12:59 -0800 | [diff] [blame] | 45 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
| 46 | #include "WSI/XlibSurfaceKHR.hpp" |
| 47 | #endif |
| 48 | |
Hernan Liatis | c7943e9 | 2019-02-25 19:29:54 -0800 | [diff] [blame] | 49 | #include "WSI/VkSwapchainKHR.hpp" |
| 50 | |
Alexis Hetu | 000df8b | 2018-10-24 15:22:41 -0400 | [diff] [blame] | 51 | #include <algorithm> |
Chris Forbes | 3d27f2e | 2018-09-26 09:24:39 -0700 | [diff] [blame] | 52 | #include <cstring> |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 53 | #include <string> |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 54 | |
Alexis Hetu | d6fae38 | 2019-04-05 13:19:46 -0400 | [diff] [blame] | 55 | namespace |
| 56 | { |
| 57 | |
| 58 | bool HasExtensionProperty(const char* extensionName, const VkExtensionProperties* extensionProperties, uint32_t extensionPropertiesCount) |
| 59 | { |
| 60 | for(uint32_t j = 0; j < extensionPropertiesCount; ++j) |
| 61 | { |
| 62 | if(strcmp(extensionName, extensionProperties[j].extensionName) == 0) |
| 63 | { |
| 64 | return true; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | return false; |
| 69 | } |
| 70 | |
| 71 | } |
| 72 | |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 73 | extern "C" |
| 74 | { |
| 75 | VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(VkInstance instance, const char* pName) |
| 76 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 77 | TRACE("(VkInstance instance = %p, const char* pName = %p)", instance, pName); |
Nicolas Capens | dc85364 | 2018-11-19 15:50:18 -0500 | [diff] [blame] | 78 | |
| 79 | return vk::GetInstanceProcAddr(instance, pName); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 80 | } |
| 81 | |
Hernan Liatis | b2841fe | 2019-02-21 12:57:52 -0800 | [diff] [blame] | 82 | VKAPI_ATTR VkResult VKAPI_CALL vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t* pSupportedVersion) |
| 83 | { |
| 84 | *pSupportedVersion = 3; |
| 85 | return VK_SUCCESS; |
| 86 | } |
| 87 | |
Hernan Liatis | 2bb0864 | 2019-02-08 14:08:21 -0800 | [diff] [blame] | 88 | static const VkExtensionProperties instanceExtensionProperties[] = |
| 89 | { |
| 90 | { VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME, VK_KHR_DEVICE_GROUP_CREATION_SPEC_VERSION }, |
| 91 | { VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME, VK_KHR_EXTERNAL_FENCE_CAPABILITIES_SPEC_VERSION }, |
| 92 | { VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME, VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION }, |
| 93 | { VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME, VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION }, |
| 94 | { VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION }, |
Chris Forbes | 1d667d6 | 2019-04-05 08:25:18 -0700 | [diff] [blame] | 95 | #ifndef __ANDROID__ |
Hernan Liatis | 2bb0864 | 2019-02-08 14:08:21 -0800 | [diff] [blame] | 96 | { VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_SURFACE_SPEC_VERSION }, |
Chris Forbes | 1d667d6 | 2019-04-05 08:25:18 -0700 | [diff] [blame] | 97 | #endif |
Hernan Liatis | 2bb0864 | 2019-02-08 14:08:21 -0800 | [diff] [blame] | 98 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
| 99 | { VK_KHR_XLIB_SURFACE_EXTENSION_NAME, VK_KHR_XLIB_SURFACE_SPEC_VERSION }, |
| 100 | #endif |
| 101 | }; |
| 102 | |
| 103 | static const VkExtensionProperties deviceExtensionProperties[] = |
| 104 | { |
| 105 | { VK_KHR_16BIT_STORAGE_EXTENSION_NAME, VK_KHR_16BIT_STORAGE_SPEC_VERSION }, |
| 106 | { VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, VK_KHR_BIND_MEMORY_2_SPEC_VERSION }, |
| 107 | { VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME, VK_KHR_DEDICATED_ALLOCATION_SPEC_VERSION }, |
| 108 | { VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION }, |
| 109 | { VK_KHR_DEVICE_GROUP_EXTENSION_NAME, VK_KHR_DEVICE_GROUP_SPEC_VERSION }, |
| 110 | { VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME, VK_KHR_EXTERNAL_FENCE_SPEC_VERSION }, |
| 111 | { VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME, VK_KHR_EXTERNAL_MEMORY_SPEC_VERSION }, |
| 112 | { VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME, VK_KHR_EXTERNAL_SEMAPHORE_SPEC_VERSION }, |
| 113 | { VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, VK_KHR_GET_MEMORY_REQUIREMENTS_2_SPEC_VERSION }, |
| 114 | { VK_KHR_MAINTENANCE1_EXTENSION_NAME, VK_KHR_MAINTENANCE1_SPEC_VERSION }, |
| 115 | { VK_KHR_MAINTENANCE2_EXTENSION_NAME, VK_KHR_MAINTENANCE2_SPEC_VERSION }, |
| 116 | { VK_KHR_MAINTENANCE3_EXTENSION_NAME, VK_KHR_MAINTENANCE3_SPEC_VERSION }, |
| 117 | { VK_KHR_MULTIVIEW_EXTENSION_NAME, VK_KHR_MULTIVIEW_SPEC_VERSION }, |
| 118 | { VK_KHR_RELAXED_BLOCK_LAYOUT_EXTENSION_NAME, VK_KHR_RELAXED_BLOCK_LAYOUT_SPEC_VERSION }, |
| 119 | { VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME, VK_KHR_SAMPLER_YCBCR_CONVERSION_SPEC_VERSION }, |
| 120 | { VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION }, |
| 121 | { VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME, VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_SPEC_VERSION }, |
| 122 | { VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME, VK_KHR_VARIABLE_POINTERS_SPEC_VERSION }, |
Chris Forbes | 1d667d6 | 2019-04-05 08:25:18 -0700 | [diff] [blame] | 123 | #ifndef __ANDROID__ |
Hernan Liatis | cff8c00 | 2019-02-25 15:56:36 -0800 | [diff] [blame] | 124 | { VK_KHR_SWAPCHAIN_EXTENSION_NAME, VK_KHR_SWAPCHAIN_SPEC_VERSION }, |
Chris Forbes | 1d667d6 | 2019-04-05 08:25:18 -0700 | [diff] [blame] | 125 | #endif |
Hernan Liatis | 2bb0864 | 2019-02-08 14:08:21 -0800 | [diff] [blame] | 126 | }; |
| 127 | |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 128 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance) |
| 129 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 130 | TRACE("(const VkInstanceCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkInstance* pInstance = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 131 | pCreateInfo, pAllocator, pInstance); |
| 132 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 133 | if(pCreateInfo->enabledLayerCount) |
| 134 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 135 | UNIMPLEMENTED("pCreateInfo->enabledLayerCount"); |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 136 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 137 | |
Alexis Hetu | d6fae38 | 2019-04-05 13:19:46 -0400 | [diff] [blame] | 138 | uint32_t extensionPropertiesCount = sizeof(instanceExtensionProperties) / sizeof(instanceExtensionProperties[0]); |
Hernan Liatis | 2bb0864 | 2019-02-08 14:08:21 -0800 | [diff] [blame] | 139 | for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; ++i) |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 140 | { |
Alexis Hetu | d6fae38 | 2019-04-05 13:19:46 -0400 | [diff] [blame] | 141 | if (!HasExtensionProperty(pCreateInfo->ppEnabledExtensionNames[i], instanceExtensionProperties, extensionPropertiesCount)) |
Hernan Liatis | 2bb0864 | 2019-02-08 14:08:21 -0800 | [diff] [blame] | 142 | { |
| 143 | return VK_ERROR_EXTENSION_NOT_PRESENT; |
| 144 | } |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | if(pCreateInfo->pNext) |
| 148 | { |
| 149 | switch(*reinterpret_cast<const VkStructureType*>(pCreateInfo->pNext)) |
| 150 | { |
| 151 | case VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO: |
| 152 | // According to the Vulkan spec, section 2.7.2. Implicit Valid Usage: |
| 153 | // "The values VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO and |
| 154 | // VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO are reserved for |
| 155 | // internal use by the loader, and do not have corresponding |
| 156 | // Vulkan structures in this Specification." |
| 157 | break; |
| 158 | default: |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 159 | UNIMPLEMENTED("pCreateInfo->pNext"); |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 160 | } |
| 161 | } |
| 162 | |
| 163 | *pInstance = VK_NULL_HANDLE; |
| 164 | VkPhysicalDevice physicalDevice = VK_NULL_HANDLE; |
| 165 | |
| 166 | VkResult result = vk::DispatchablePhysicalDevice::Create(pAllocator, pCreateInfo, &physicalDevice); |
| 167 | if(result != VK_SUCCESS) |
| 168 | { |
| 169 | return result; |
| 170 | } |
| 171 | |
| 172 | vk::Instance::CreateInfo info = |
| 173 | { |
| 174 | pCreateInfo, |
| 175 | physicalDevice |
| 176 | }; |
| 177 | |
| 178 | result = vk::DispatchableInstance::Create(pAllocator, &info, pInstance); |
| 179 | if(result != VK_SUCCESS) |
| 180 | { |
| 181 | vk::destroy(physicalDevice, pAllocator); |
| 182 | return result; |
| 183 | } |
| 184 | |
| 185 | return result; |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 186 | } |
| 187 | |
| 188 | VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks* pAllocator) |
| 189 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 190 | TRACE("(VkInstance instance = %p, const VkAllocationCallbacks* pAllocator = %p)", instance, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 191 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 192 | vk::destroy(instance, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 193 | } |
| 194 | |
| 195 | VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices) |
| 196 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 197 | TRACE("(VkInstance instance = %p, uint32_t* pPhysicalDeviceCount = %p, VkPhysicalDevice* pPhysicalDevices = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 198 | instance, pPhysicalDeviceCount, pPhysicalDevices); |
| 199 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 200 | if(!pPhysicalDevices) |
| 201 | { |
| 202 | *pPhysicalDeviceCount = vk::Cast(instance)->getPhysicalDeviceCount(); |
| 203 | } |
| 204 | else |
| 205 | { |
| 206 | vk::Cast(instance)->getPhysicalDevices(*pPhysicalDeviceCount, pPhysicalDevices); |
| 207 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 208 | |
| 209 | return VK_SUCCESS; |
| 210 | } |
| 211 | |
| 212 | VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) |
| 213 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 214 | TRACE("(VkPhysicalDevice physicalDevice = %p, VkPhysicalDeviceFeatures* pFeatures = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 215 | physicalDevice, pFeatures); |
| 216 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 217 | *pFeatures = vk::Cast(physicalDevice)->getFeatures(); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) |
| 221 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 222 | TRACE("GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice = %p, VkFormat format = %d, VkFormatProperties* pFormatProperties = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 223 | physicalDevice, (int)format, pFormatProperties); |
| 224 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 225 | vk::Cast(physicalDevice)->getFormatProperties(format, pFormatProperties); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 226 | } |
| 227 | |
| 228 | VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) |
| 229 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 230 | TRACE("(VkPhysicalDevice physicalDevice = %p, VkFormat format = %d, VkImageType type = %d, VkImageTiling tiling = %d, VkImageUsageFlags usage = %d, VkImageCreateFlags flags = %d, VkImageFormatProperties* pImageFormatProperties = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 231 | physicalDevice, (int)format, (int)type, (int)tiling, usage, flags, pImageFormatProperties); |
| 232 | |
Chris Forbes | 5737833 | 2019-01-16 15:17:24 -0800 | [diff] [blame] | 233 | VkFormatProperties properties; |
| 234 | vk::Cast(physicalDevice)->getFormatProperties(format, &properties); |
| 235 | |
| 236 | switch (tiling) |
| 237 | { |
| 238 | case VK_IMAGE_TILING_LINEAR: |
| 239 | if (properties.linearTilingFeatures == 0) return VK_ERROR_FORMAT_NOT_SUPPORTED; |
| 240 | break; |
| 241 | |
| 242 | case VK_IMAGE_TILING_OPTIMAL: |
| 243 | if (properties.optimalTilingFeatures == 0) return VK_ERROR_FORMAT_NOT_SUPPORTED; |
| 244 | break; |
| 245 | |
| 246 | default: |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 247 | UNIMPLEMENTED("tiling"); |
Chris Forbes | 5737833 | 2019-01-16 15:17:24 -0800 | [diff] [blame] | 248 | } |
| 249 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 250 | vk::Cast(physicalDevice)->getImageFormatProperties(format, type, tiling, usage, flags, pImageFormatProperties); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 251 | |
| 252 | return VK_SUCCESS; |
| 253 | } |
| 254 | |
| 255 | VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties) |
| 256 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 257 | TRACE("(VkPhysicalDevice physicalDevice = %p, VkPhysicalDeviceProperties* pProperties = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 258 | physicalDevice, pProperties); |
| 259 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 260 | *pProperties = vk::Cast(physicalDevice)->getProperties(); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 261 | } |
| 262 | |
| 263 | VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties) |
| 264 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 265 | TRACE("(VkPhysicalDevice physicalDevice = %p, uint32_t* pQueueFamilyPropertyCount = %p, VkQueueFamilyProperties* pQueueFamilyProperties = %p))", physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 266 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 267 | if(!pQueueFamilyProperties) |
| 268 | { |
| 269 | *pQueueFamilyPropertyCount = vk::Cast(physicalDevice)->getQueueFamilyPropertyCount(); |
| 270 | } |
| 271 | else |
| 272 | { |
| 273 | vk::Cast(physicalDevice)->getQueueFamilyProperties(*pQueueFamilyPropertyCount, pQueueFamilyProperties); |
| 274 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 275 | } |
| 276 | |
| 277 | VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties) |
| 278 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 279 | TRACE("(VkPhysicalDevice physicalDevice = %p, VkPhysicalDeviceMemoryProperties* pMemoryProperties = %p)", physicalDevice, pMemoryProperties); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 280 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 281 | *pMemoryProperties = vk::Cast(physicalDevice)->getMemoryProperties(); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 282 | } |
| 283 | |
| 284 | VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char* pName) |
| 285 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 286 | TRACE("(VkInstance instance = %p, const char* pName = %p)", instance, pName); |
Nicolas Capens | dc85364 | 2018-11-19 15:50:18 -0500 | [diff] [blame] | 287 | |
| 288 | return vk::GetInstanceProcAddr(instance, pName); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 289 | } |
| 290 | |
| 291 | VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char* pName) |
| 292 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 293 | TRACE("(VkDevice device = %p, const char* pName = %p)", device, pName); |
Nicolas Capens | dc85364 | 2018-11-19 15:50:18 -0500 | [diff] [blame] | 294 | |
| 295 | return vk::GetDeviceProcAddr(device, pName); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 296 | } |
| 297 | |
| 298 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) |
| 299 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 300 | TRACE("(VkPhysicalDevice physicalDevice = %p, const VkDeviceCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkDevice* pDevice = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 301 | physicalDevice, pCreateInfo, pAllocator, pDevice); |
| 302 | |
Nicolas Capens | d689d1c | 2018-11-19 16:02:36 -0500 | [diff] [blame] | 303 | if(pCreateInfo->enabledLayerCount) |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 304 | { |
Nicolas Capens | d689d1c | 2018-11-19 16:02:36 -0500 | [diff] [blame] | 305 | // "The ppEnabledLayerNames and enabledLayerCount members of VkDeviceCreateInfo are deprecated and their values must be ignored by implementations." |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 306 | UNIMPLEMENTED("pCreateInfo->enabledLayerCount"); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here. |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 307 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 308 | |
Alexis Hetu | d6fae38 | 2019-04-05 13:19:46 -0400 | [diff] [blame] | 309 | uint32_t extensionPropertiesCount = sizeof(deviceExtensionProperties) / sizeof(deviceExtensionProperties[0]); |
Hernan Liatis | cff8c00 | 2019-02-25 15:56:36 -0800 | [diff] [blame] | 310 | for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; ++i) |
| 311 | { |
Alexis Hetu | d6fae38 | 2019-04-05 13:19:46 -0400 | [diff] [blame] | 312 | if (!HasExtensionProperty(pCreateInfo->ppEnabledExtensionNames[i], deviceExtensionProperties, extensionPropertiesCount)) |
Hernan Liatis | cff8c00 | 2019-02-25 15:56:36 -0800 | [diff] [blame] | 313 | { |
| 314 | return VK_ERROR_EXTENSION_NOT_PRESENT; |
| 315 | } |
| 316 | } |
| 317 | |
Nicolas Capens | d689d1c | 2018-11-19 16:02:36 -0500 | [diff] [blame] | 318 | const VkBaseInStructure* extensionCreateInfo = reinterpret_cast<const VkBaseInStructure*>(pCreateInfo->pNext); |
| 319 | |
| 320 | while(extensionCreateInfo) |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 321 | { |
Nicolas Capens | d689d1c | 2018-11-19 16:02:36 -0500 | [diff] [blame] | 322 | switch(extensionCreateInfo->sType) |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 323 | { |
| 324 | case VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO: |
| 325 | // According to the Vulkan spec, section 2.7.2. Implicit Valid Usage: |
| 326 | // "The values VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO and |
| 327 | // VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO are reserved for |
| 328 | // internal use by the loader, and do not have corresponding |
| 329 | // Vulkan structures in this Specification." |
| 330 | break; |
Nicolas Capens | d689d1c | 2018-11-19 16:02:36 -0500 | [diff] [blame] | 331 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: |
| 332 | { |
| 333 | ASSERT(!pCreateInfo->pEnabledFeatures); // "If the pNext chain includes a VkPhysicalDeviceFeatures2 structure, then pEnabledFeatures must be NULL" |
| 334 | |
| 335 | const VkPhysicalDeviceFeatures2* physicalDeviceFeatures2 = reinterpret_cast<const VkPhysicalDeviceFeatures2*>(extensionCreateInfo); |
| 336 | |
| 337 | if(!vk::Cast(physicalDevice)->hasFeatures(physicalDeviceFeatures2->features)) |
| 338 | { |
| 339 | return VK_ERROR_FEATURE_NOT_PRESENT; |
| 340 | } |
| 341 | } |
| 342 | break; |
| 343 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: |
| 344 | { |
| 345 | const VkPhysicalDeviceSamplerYcbcrConversionFeatures* samplerYcbcrConversionFeatures = reinterpret_cast<const VkPhysicalDeviceSamplerYcbcrConversionFeatures*>(extensionCreateInfo); |
| 346 | |
| 347 | if(samplerYcbcrConversionFeatures->samplerYcbcrConversion == VK_TRUE) |
| 348 | { |
| 349 | return VK_ERROR_FEATURE_NOT_PRESENT; |
| 350 | } |
| 351 | } |
| 352 | break; |
| 353 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: |
| 354 | { |
| 355 | const VkPhysicalDevice16BitStorageFeatures* storage16BitFeatures = reinterpret_cast<const VkPhysicalDevice16BitStorageFeatures*>(extensionCreateInfo); |
| 356 | |
| 357 | if(storage16BitFeatures->storageBuffer16BitAccess == VK_TRUE || |
| 358 | storage16BitFeatures->uniformAndStorageBuffer16BitAccess == VK_TRUE || |
| 359 | storage16BitFeatures->storagePushConstant16 == VK_TRUE || |
| 360 | storage16BitFeatures->storageInputOutput16 == VK_TRUE) |
| 361 | { |
| 362 | return VK_ERROR_FEATURE_NOT_PRESENT; |
| 363 | } |
| 364 | } |
| 365 | break; |
| 366 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES: |
| 367 | { |
| 368 | const VkPhysicalDeviceVariablePointerFeatures* variablePointerFeatures = reinterpret_cast<const VkPhysicalDeviceVariablePointerFeatures*>(extensionCreateInfo); |
| 369 | |
| 370 | if(variablePointerFeatures->variablePointersStorageBuffer == VK_TRUE || |
| 371 | variablePointerFeatures->variablePointers == VK_TRUE) |
| 372 | { |
| 373 | return VK_ERROR_FEATURE_NOT_PRESENT; |
| 374 | } |
| 375 | } |
| 376 | break; |
Alexis Hetu | 5ebd2c0 | 2019-01-22 17:17:27 -0500 | [diff] [blame] | 377 | case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: |
| 378 | { |
| 379 | const VkDeviceGroupDeviceCreateInfo* groupDeviceCreateInfo = reinterpret_cast<const VkDeviceGroupDeviceCreateInfo*>(extensionCreateInfo); |
| 380 | |
| 381 | if((groupDeviceCreateInfo->physicalDeviceCount != 1) || |
| 382 | (groupDeviceCreateInfo->pPhysicalDevices[0] != physicalDevice)) |
| 383 | { |
| 384 | return VK_ERROR_FEATURE_NOT_PRESENT; |
| 385 | } |
| 386 | } |
| 387 | break; |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 388 | default: |
Nicolas Capens | d689d1c | 2018-11-19 16:02:36 -0500 | [diff] [blame] | 389 | // "the [driver] must skip over, without processing (other than reading the sType and pNext members) any structures in the chain with sType values not defined by [supported extenions]" |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 390 | UNIMPLEMENTED("extensionCreateInfo->sType"); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here. |
Nicolas Capens | d689d1c | 2018-11-19 16:02:36 -0500 | [diff] [blame] | 391 | break; |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 392 | } |
Nicolas Capens | d689d1c | 2018-11-19 16:02:36 -0500 | [diff] [blame] | 393 | |
| 394 | extensionCreateInfo = extensionCreateInfo->pNext; |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 395 | } |
| 396 | |
| 397 | ASSERT(pCreateInfo->queueCreateInfoCount > 0); |
| 398 | |
Nicolas Capens | d5f1489 | 2018-11-13 14:06:37 -0500 | [diff] [blame] | 399 | if(pCreateInfo->pEnabledFeatures) |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 400 | { |
Nicolas Capens | d5f1489 | 2018-11-13 14:06:37 -0500 | [diff] [blame] | 401 | if(!vk::Cast(physicalDevice)->hasFeatures(*(pCreateInfo->pEnabledFeatures))) |
| 402 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 403 | UNIMPLEMENTED("pCreateInfo->pEnabledFeatures"); |
Nicolas Capens | d5f1489 | 2018-11-13 14:06:37 -0500 | [diff] [blame] | 404 | return VK_ERROR_FEATURE_NOT_PRESENT; |
| 405 | } |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 406 | } |
| 407 | |
| 408 | uint32_t queueFamilyPropertyCount = vk::Cast(physicalDevice)->getQueueFamilyPropertyCount(); |
| 409 | |
| 410 | for(uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; i++) |
| 411 | { |
| 412 | const VkDeviceQueueCreateInfo& queueCreateInfo = pCreateInfo->pQueueCreateInfos[i]; |
| 413 | if(queueCreateInfo.pNext || queueCreateInfo.flags) |
| 414 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 415 | UNIMPLEMENTED("queueCreateInfo.pNext || queueCreateInfo.flags"); |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 416 | } |
| 417 | |
| 418 | ASSERT(queueCreateInfo.queueFamilyIndex < queueFamilyPropertyCount); |
Nicolas Capens | d689d1c | 2018-11-19 16:02:36 -0500 | [diff] [blame] | 419 | (void)queueFamilyPropertyCount; // Silence unused variable warning |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 420 | } |
| 421 | |
| 422 | vk::Device::CreateInfo deviceCreateInfo = |
| 423 | { |
| 424 | pCreateInfo, |
| 425 | physicalDevice |
| 426 | }; |
| 427 | |
| 428 | return vk::DispatchableDevice::Create(pAllocator, &deviceCreateInfo, pDevice); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 429 | } |
| 430 | |
| 431 | VKAPI_ATTR void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator) |
| 432 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 433 | TRACE("(VkDevice device = %p, const VkAllocationCallbacks* pAllocator = %p)", device, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 434 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 435 | vk::destroy(device, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 436 | } |
| 437 | |
| 438 | VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties(const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties) |
| 439 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 440 | TRACE("(const char* pLayerName = %p, uint32_t* pPropertyCount = %p, VkExtensionProperties* pProperties = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 441 | pLayerName, pPropertyCount, pProperties); |
| 442 | |
Hernan Liatis | 2bb0864 | 2019-02-08 14:08:21 -0800 | [diff] [blame] | 443 | uint32_t extensionPropertiesCount = sizeof(instanceExtensionProperties) / sizeof(instanceExtensionProperties[0]); |
Chris Forbes | 5978150 | 2018-10-25 11:19:54 -0700 | [diff] [blame] | 444 | |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 445 | if(!pProperties) |
| 446 | { |
Chris Forbes | 5978150 | 2018-10-25 11:19:54 -0700 | [diff] [blame] | 447 | *pPropertyCount = extensionPropertiesCount; |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 448 | return VK_SUCCESS; |
| 449 | } |
| 450 | |
Chris Forbes | 5978150 | 2018-10-25 11:19:54 -0700 | [diff] [blame] | 451 | for(uint32_t i = 0; i < std::min(*pPropertyCount, extensionPropertiesCount); i++) |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 452 | { |
Hernan Liatis | 2bb0864 | 2019-02-08 14:08:21 -0800 | [diff] [blame] | 453 | pProperties[i] = instanceExtensionProperties[i]; |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 454 | } |
| 455 | |
Chris Forbes | 5978150 | 2018-10-25 11:19:54 -0700 | [diff] [blame] | 456 | return (*pPropertyCount < extensionPropertiesCount) ? VK_INCOMPLETE : VK_SUCCESS; |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 457 | } |
| 458 | |
| 459 | VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties) |
| 460 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 461 | TRACE("(VkPhysicalDevice physicalDevice = %p, const char* pLayerName, uint32_t* pPropertyCount = %p, VkExtensionProperties* pProperties = %p)", physicalDevice, pPropertyCount, pProperties); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 462 | |
Hernan Liatis | 2bb0864 | 2019-02-08 14:08:21 -0800 | [diff] [blame] | 463 | uint32_t extensionPropertiesCount = sizeof(deviceExtensionProperties) / sizeof(deviceExtensionProperties[0]); |
Chris Forbes | 5978150 | 2018-10-25 11:19:54 -0700 | [diff] [blame] | 464 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 465 | if(!pProperties) |
| 466 | { |
Chris Forbes | 5978150 | 2018-10-25 11:19:54 -0700 | [diff] [blame] | 467 | *pPropertyCount = extensionPropertiesCount; |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 468 | return VK_SUCCESS; |
| 469 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 470 | |
Chris Forbes | 5978150 | 2018-10-25 11:19:54 -0700 | [diff] [blame] | 471 | for(uint32_t i = 0; i < std::min(*pPropertyCount, extensionPropertiesCount); i++) |
| 472 | { |
Hernan Liatis | 2bb0864 | 2019-02-08 14:08:21 -0800 | [diff] [blame] | 473 | pProperties[i] = deviceExtensionProperties[i]; |
Chris Forbes | 5978150 | 2018-10-25 11:19:54 -0700 | [diff] [blame] | 474 | } |
| 475 | |
| 476 | return (*pPropertyCount < extensionPropertiesCount) ? VK_INCOMPLETE : VK_SUCCESS; |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 477 | } |
| 478 | |
| 479 | VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t* pPropertyCount, VkLayerProperties* pProperties) |
| 480 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 481 | TRACE("(uint32_t* pPropertyCount = %p, VkLayerProperties* pProperties = %p)", pPropertyCount, pProperties); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 482 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 483 | if(!pProperties) |
| 484 | { |
| 485 | *pPropertyCount = 0; |
| 486 | return VK_SUCCESS; |
| 487 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 488 | |
| 489 | return VK_SUCCESS; |
| 490 | } |
| 491 | |
| 492 | VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties) |
| 493 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 494 | TRACE("(VkPhysicalDevice physicalDevice = %p, uint32_t* pPropertyCount = %p, VkLayerProperties* pProperties = %p)", physicalDevice, pPropertyCount, pProperties); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 495 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 496 | if(!pProperties) |
| 497 | { |
| 498 | *pPropertyCount = 0; |
| 499 | return VK_SUCCESS; |
| 500 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 501 | |
| 502 | return VK_SUCCESS; |
| 503 | } |
| 504 | |
| 505 | VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue) |
| 506 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 507 | TRACE("(VkDevice device = %p, uint32_t queueFamilyIndex = %d, uint32_t queueIndex = %d, VkQueue* pQueue = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 508 | device, queueFamilyIndex, queueIndex, pQueue); |
| 509 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 510 | *pQueue = vk::Cast(device)->getQueue(queueFamilyIndex, queueIndex); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 511 | } |
| 512 | |
| 513 | VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence) |
| 514 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 515 | TRACE("(VkQueue queue = %p, uint32_t submitCount = %d, const VkSubmitInfo* pSubmits = %p, VkFence fence = %p)", |
Alexis Hetu | 072dc0d | 2018-10-31 11:41:25 -0400 | [diff] [blame] | 516 | queue, submitCount, pSubmits, fence); |
| 517 | |
| 518 | vk::Cast(queue)->submit(submitCount, pSubmits, fence); |
| 519 | |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 520 | return VK_SUCCESS; |
| 521 | } |
| 522 | |
Nicolas Capens | de16f32 | 2019-02-12 00:32:31 -0500 | [diff] [blame] | 523 | VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue) |
| 524 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 525 | TRACE("(VkQueue queue = %p)", queue); |
Nicolas Capens | de16f32 | 2019-02-12 00:32:31 -0500 | [diff] [blame] | 526 | |
| 527 | vk::Cast(queue)->waitIdle(); |
| 528 | |
| 529 | return VK_SUCCESS; |
| 530 | } |
| 531 | |
| 532 | VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device) |
| 533 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 534 | TRACE("(VkDevice device = %p)", device); |
Nicolas Capens | de16f32 | 2019-02-12 00:32:31 -0500 | [diff] [blame] | 535 | |
| 536 | vk::Cast(device)->waitIdle(); |
| 537 | |
| 538 | return VK_SUCCESS; |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 539 | } |
| 540 | |
| 541 | VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory) |
| 542 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 543 | TRACE("(VkDevice device = %p, const VkMemoryAllocateInfo* pAllocateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkDeviceMemory* pMemory = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 544 | device, pAllocateInfo, pAllocator, pMemory); |
| 545 | |
Alexis Hetu | 0083573 | 2019-04-10 16:36:31 -0400 | [diff] [blame] | 546 | const VkBaseInStructure* allocationInfo = reinterpret_cast<const VkBaseInStructure*>(pAllocateInfo->pNext); |
Alexis Hetu | 7ca9f4a | 2019-01-17 14:51:43 -0500 | [diff] [blame] | 547 | while(allocationInfo) |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 548 | { |
Alexis Hetu | 7ca9f4a | 2019-01-17 14:51:43 -0500 | [diff] [blame] | 549 | switch(allocationInfo->sType) |
| 550 | { |
| 551 | case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: |
| 552 | // This can safely be ignored, as the Vulkan spec mentions: |
| 553 | // "If the pNext chain includes a VkMemoryDedicatedAllocateInfo structure, then that structure |
| 554 | // includes a handle of the sole buffer or image resource that the memory *can* be bound to." |
| 555 | break; |
| 556 | default: |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 557 | UNIMPLEMENTED("allocationInfo->sType"); |
Alexis Hetu | 7ca9f4a | 2019-01-17 14:51:43 -0500 | [diff] [blame] | 558 | break; |
| 559 | } |
| 560 | |
| 561 | allocationInfo = allocationInfo->pNext; |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 562 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 563 | |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 564 | VkResult result = vk::DeviceMemory::Create(pAllocator, pAllocateInfo, pMemory); |
| 565 | if(result != VK_SUCCESS) |
| 566 | { |
| 567 | return result; |
| 568 | } |
| 569 | |
| 570 | // Make sure the memory allocation is done now so that OOM errors can be checked now |
| 571 | result = vk::Cast(*pMemory)->allocate(); |
| 572 | if(result != VK_SUCCESS) |
| 573 | { |
| 574 | vk::destroy(*pMemory, pAllocator); |
| 575 | *pMemory = VK_NULL_HANDLE; |
| 576 | } |
| 577 | |
| 578 | return result; |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 579 | } |
| 580 | |
| 581 | VKAPI_ATTR void VKAPI_CALL vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator) |
| 582 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 583 | TRACE("(VkDevice device = %p, VkDeviceMemory memory = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 584 | device, memory, pAllocator); |
| 585 | |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 586 | vk::destroy(memory, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 587 | } |
| 588 | |
| 589 | VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData) |
| 590 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 591 | TRACE("(VkDevice device = %p, VkDeviceMemory memory = %p, VkDeviceSize offset = %d, VkDeviceSize size = %d, VkMemoryMapFlags flags = %d, void** ppData = %p)", |
| 592 | device, memory, int(offset), int(size), flags, ppData); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 593 | |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 594 | return vk::Cast(memory)->map(offset, size, ppData); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 595 | } |
| 596 | |
| 597 | VKAPI_ATTR void VKAPI_CALL vkUnmapMemory(VkDevice device, VkDeviceMemory memory) |
| 598 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 599 | TRACE("(VkDevice device = %p, VkDeviceMemory memory = %p)", device, memory); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 600 | |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 601 | // Noop, memory will be released when the DeviceMemory object is released |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 602 | } |
| 603 | |
| 604 | VKAPI_ATTR VkResult VKAPI_CALL vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges) |
| 605 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 606 | TRACE("(VkDevice device = %p, uint32_t memoryRangeCount = %d, const VkMappedMemoryRange* pMemoryRanges = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 607 | device, memoryRangeCount, pMemoryRanges); |
| 608 | |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 609 | // Noop, host and device memory are the same to SwiftShader |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 610 | |
| 611 | return VK_SUCCESS; |
| 612 | } |
| 613 | |
| 614 | VKAPI_ATTR VkResult VKAPI_CALL vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges) |
| 615 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 616 | TRACE("(VkDevice device = %p, uint32_t memoryRangeCount = %d, const VkMappedMemoryRange* pMemoryRanges = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 617 | device, memoryRangeCount, pMemoryRanges); |
| 618 | |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 619 | // Noop, host and device memory are the same to SwiftShader |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 620 | |
| 621 | return VK_SUCCESS; |
| 622 | } |
| 623 | |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 624 | VKAPI_ATTR void VKAPI_CALL vkGetDeviceMemoryCommitment(VkDevice pDevice, VkDeviceMemory pMemory, VkDeviceSize* pCommittedMemoryInBytes) |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 625 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 626 | TRACE("(VkDevice device = %p, VkDeviceMemory memory = %p, VkDeviceSize* pCommittedMemoryInBytes = %p)", |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 627 | pDevice, pMemory, pCommittedMemoryInBytes); |
| 628 | |
| 629 | auto memory = vk::Cast(pMemory); |
| 630 | |
| 631 | #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) |
| 632 | const auto& memoryProperties = vk::Cast(vk::Cast(pDevice)->getPhysicalDevice())->getMemoryProperties(); |
| 633 | uint32_t typeIndex = memory->getMemoryTypeIndex(); |
| 634 | ASSERT(typeIndex < memoryProperties.memoryTypeCount); |
| 635 | ASSERT(memoryProperties.memoryTypes[typeIndex].propertyFlags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT); |
| 636 | #endif |
| 637 | |
| 638 | *pCommittedMemoryInBytes = memory->getCommittedMemoryInBytes(); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 639 | } |
| 640 | |
| 641 | VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset) |
| 642 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 643 | TRACE("(VkDevice device = %p, VkBuffer buffer = %p, VkDeviceMemory memory = %p, VkDeviceSize memoryOffset = %d)", |
| 644 | device, buffer, memory, int(memoryOffset)); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 645 | |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 646 | vk::Cast(buffer)->bind(memory, memoryOffset); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 647 | |
| 648 | return VK_SUCCESS; |
| 649 | } |
| 650 | |
| 651 | VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset) |
| 652 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 653 | TRACE("(VkDevice device = %p, VkImage image = %p, VkDeviceMemory memory = %p, VkDeviceSize memoryOffset = %d)", |
| 654 | device, image, memory, int(memoryOffset)); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 655 | |
Alexis Hetu | a233cea | 2018-12-07 11:53:19 -0500 | [diff] [blame] | 656 | vk::Cast(image)->bind(memory, memoryOffset); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 657 | |
| 658 | return VK_SUCCESS; |
| 659 | } |
| 660 | |
| 661 | VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements) |
| 662 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 663 | TRACE("(VkDevice device = %p, VkBuffer buffer = %p, VkMemoryRequirements* pMemoryRequirements = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 664 | device, buffer, pMemoryRequirements); |
| 665 | |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 666 | *pMemoryRequirements = vk::Cast(buffer)->getMemoryRequirements(); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 667 | } |
| 668 | |
| 669 | VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements) |
| 670 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 671 | TRACE("(VkDevice device = %p, VkImage image = %p, VkMemoryRequirements* pMemoryRequirements = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 672 | device, image, pMemoryRequirements); |
| 673 | |
Alexis Hetu | a233cea | 2018-12-07 11:53:19 -0500 | [diff] [blame] | 674 | *pMemoryRequirements = vk::Cast(image)->getMemoryRequirements(); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 675 | } |
| 676 | |
| 677 | VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
| 678 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 679 | TRACE("(VkDevice device = %p, VkImage image = %p, uint32_t* pSparseMemoryRequirementCount = %p, VkSparseImageMemoryRequirements* pSparseMemoryRequirements = %p)", |
Alexis Hetu | 1424ef6 | 2019-04-05 18:03:53 -0400 | [diff] [blame] | 680 | device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 681 | |
Nicolas Capens | 5028a58 | 2018-11-13 15:03:35 -0500 | [diff] [blame] | 682 | // The 'sparseBinding' feature is not supported, so images can not be created with the VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT flag. |
| 683 | // "If the image was not created with VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT then pSparseMemoryRequirementCount will be set to zero and pSparseMemoryRequirements will not be written to." |
| 684 | *pSparseMemoryRequirementCount = 0; |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 685 | } |
| 686 | |
| 687 | VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties) |
| 688 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 689 | TRACE("(VkPhysicalDevice physicalDevice = %p, VkFormat format = %d, VkImageType type = %d, VkSampleCountFlagBits samples = %d, VkImageUsageFlags usage = %d, VkImageTiling tiling = %d, uint32_t* pPropertyCount = %p, VkSparseImageFormatProperties* pProperties = %p)", |
Chris Forbes | 2c25b14 | 2019-03-05 14:47:16 -0800 | [diff] [blame] | 690 | physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties); |
| 691 | |
| 692 | // We do not support sparse images. |
| 693 | *pPropertyCount = 0; |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 694 | } |
| 695 | |
| 696 | VKAPI_ATTR VkResult VKAPI_CALL vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence) |
| 697 | { |
| 698 | TRACE("()"); |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 699 | UNIMPLEMENTED("vkQueueBindSparse"); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 700 | return VK_SUCCESS; |
| 701 | } |
| 702 | |
| 703 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence) |
| 704 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 705 | TRACE("(VkDevice device = %p, const VkFenceCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkFence* pFence = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 706 | device, pCreateInfo, pAllocator, pFence); |
| 707 | |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 708 | if(pCreateInfo->pNext) |
| 709 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 710 | UNIMPLEMENTED("pCreateInfo->pNext"); |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 711 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 712 | |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 713 | return vk::Fence::Create(pAllocator, pCreateInfo, pFence); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 714 | } |
| 715 | |
| 716 | VKAPI_ATTR void VKAPI_CALL vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator) |
| 717 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 718 | TRACE("(VkDevice device = %p, VkFence fence = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 719 | device, fence, pAllocator); |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 720 | |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 721 | |
| 722 | vk::destroy(fence, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 723 | } |
| 724 | |
| 725 | VKAPI_ATTR VkResult VKAPI_CALL vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) |
| 726 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 727 | TRACE("(VkDevice device = %p, uint32_t fenceCount = %d, const VkFence* pFences = %p)", |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 728 | device, fenceCount, pFences); |
| 729 | |
| 730 | for(uint32_t i = 0; i < fenceCount; i++) |
| 731 | { |
| 732 | vk::Cast(pFences[i])->reset(); |
| 733 | } |
| 734 | |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 735 | return VK_SUCCESS; |
| 736 | } |
| 737 | |
| 738 | VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceStatus(VkDevice device, VkFence fence) |
| 739 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 740 | TRACE("(VkDevice device = %p, VkFence fence = %p)", device, fence); |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 741 | |
| 742 | return vk::Cast(fence)->getStatus(); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 743 | } |
| 744 | |
| 745 | VKAPI_ATTR VkResult VKAPI_CALL vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) |
| 746 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 747 | TRACE("(VkDevice device = %p, uint32_t fenceCount = %d, const VkFence* pFences = %p, VkBool32 waitAll = %d, uint64_t timeout = %d)", |
| 748 | device, int(fenceCount), pFences, int(waitAll), int(timeout)); |
Alexis Hetu | c4bd9df | 2018-12-07 11:28:40 -0500 | [diff] [blame] | 749 | |
| 750 | vk::Cast(device)->waitForFences(fenceCount, pFences, waitAll, timeout); |
| 751 | |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 752 | return VK_SUCCESS; |
| 753 | } |
| 754 | |
| 755 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore) |
| 756 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 757 | TRACE("(VkDevice device = %p, const VkSemaphoreCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkSemaphore* pSemaphore = %p)", |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 758 | device, pCreateInfo, pAllocator, pSemaphore); |
| 759 | |
| 760 | if(pCreateInfo->pNext || pCreateInfo->flags) |
| 761 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 762 | UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags"); |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 763 | } |
| 764 | |
| 765 | return vk::Semaphore::Create(pAllocator, pCreateInfo, pSemaphore); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 766 | } |
| 767 | |
| 768 | VKAPI_ATTR void VKAPI_CALL vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator) |
| 769 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 770 | TRACE("(VkDevice device = %p, VkSemaphore semaphore = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 771 | device, semaphore, pAllocator); |
| 772 | |
| 773 | vk::destroy(semaphore, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 774 | } |
| 775 | |
| 776 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent) |
| 777 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 778 | TRACE("(VkDevice device = %p, const VkEventCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkEvent* pEvent = %p)", |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 779 | device, pCreateInfo, pAllocator, pEvent); |
| 780 | |
| 781 | if(pCreateInfo->pNext || pCreateInfo->flags) |
| 782 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 783 | UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags"); |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 784 | } |
| 785 | |
| 786 | return vk::Event::Create(pAllocator, pCreateInfo, pEvent); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 787 | } |
| 788 | |
| 789 | VKAPI_ATTR void VKAPI_CALL vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator) |
| 790 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 791 | TRACE("(VkDevice device = %p, VkEvent event = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 792 | device, event, pAllocator); |
| 793 | |
| 794 | vk::destroy(event, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 795 | } |
| 796 | |
| 797 | VKAPI_ATTR VkResult VKAPI_CALL vkGetEventStatus(VkDevice device, VkEvent event) |
| 798 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 799 | TRACE("(VkDevice device = %p, VkEvent event = %p)", device, event); |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 800 | |
| 801 | return vk::Cast(event)->getStatus(); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 802 | } |
| 803 | |
| 804 | VKAPI_ATTR VkResult VKAPI_CALL vkSetEvent(VkDevice device, VkEvent event) |
| 805 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 806 | TRACE("(VkDevice device = %p, VkEvent event = %p)", device, event); |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 807 | |
| 808 | vk::Cast(event)->signal(); |
| 809 | |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 810 | return VK_SUCCESS; |
| 811 | } |
| 812 | |
| 813 | VKAPI_ATTR VkResult VKAPI_CALL vkResetEvent(VkDevice device, VkEvent event) |
| 814 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 815 | TRACE("(VkDevice device = %p, VkEvent event = %p)", device, event); |
Alexis Hetu | 1f23d8c | 2018-10-16 14:40:19 -0400 | [diff] [blame] | 816 | |
| 817 | vk::Cast(event)->reset(); |
| 818 | |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 819 | return VK_SUCCESS; |
| 820 | } |
| 821 | |
| 822 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool) |
| 823 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 824 | TRACE("(VkDevice device = %p, const VkQueryPoolCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkQueryPool* pQueryPool = %p)", |
Alexis Hetu | 86f8bdb | 2019-01-22 12:07:24 -0500 | [diff] [blame] | 825 | device, pCreateInfo, pAllocator, pQueryPool); |
| 826 | |
| 827 | if(pCreateInfo->pNext || pCreateInfo->flags) |
| 828 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 829 | UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags"); |
Alexis Hetu | 86f8bdb | 2019-01-22 12:07:24 -0500 | [diff] [blame] | 830 | } |
| 831 | |
| 832 | return vk::QueryPool::Create(pAllocator, pCreateInfo, pQueryPool); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 833 | } |
| 834 | |
| 835 | VKAPI_ATTR void VKAPI_CALL vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator) |
| 836 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 837 | TRACE("(VkDevice device = %p, VkQueryPool queryPool = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | 86f8bdb | 2019-01-22 12:07:24 -0500 | [diff] [blame] | 838 | device, queryPool, pAllocator); |
| 839 | |
| 840 | vk::destroy(queryPool, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 841 | } |
| 842 | |
| 843 | VKAPI_ATTR VkResult VKAPI_CALL vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags) |
| 844 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 845 | TRACE("(VkDevice device = %p, VkQueryPool queryPool = %p, uint32_t firstQuery = %d, uint32_t queryCount = %d, size_t dataSize = %d, void* pData = %p, VkDeviceSize stride = %d, VkQueryResultFlags flags = %d)", |
| 846 | device, queryPool, int(firstQuery), int(queryCount), int(dataSize), pData, int(stride), flags); |
Alexis Hetu | 86f8bdb | 2019-01-22 12:07:24 -0500 | [diff] [blame] | 847 | |
Alexis Hetu | f0aa9d5 | 2019-04-01 17:06:47 -0400 | [diff] [blame] | 848 | return vk::Cast(queryPool)->getResults(firstQuery, queryCount, dataSize, pData, stride, flags); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 849 | } |
| 850 | |
| 851 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer) |
| 852 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 853 | TRACE("(VkDevice device = %p, const VkBufferCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkBuffer* pBuffer = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 854 | device, pCreateInfo, pAllocator, pBuffer); |
| 855 | |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 856 | if(pCreateInfo->pNext) |
| 857 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 858 | UNIMPLEMENTED("pCreateInfo->pNext"); |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 859 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 860 | |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 861 | return vk::Buffer::Create(pAllocator, pCreateInfo, pBuffer); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 862 | } |
| 863 | |
| 864 | VKAPI_ATTR void VKAPI_CALL vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator) |
| 865 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 866 | TRACE("(VkDevice device = %p, VkBuffer buffer = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 867 | device, buffer, pAllocator); |
| 868 | |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 869 | vk::destroy(buffer, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 870 | } |
| 871 | |
| 872 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView) |
| 873 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 874 | TRACE("(VkDevice device = %p, const VkBufferViewCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkBufferView* pView = %p)", |
Alexis Hetu | 1424ef6 | 2019-04-05 18:03:53 -0400 | [diff] [blame] | 875 | device, pCreateInfo, pAllocator, pView); |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 876 | |
| 877 | if(pCreateInfo->pNext || pCreateInfo->flags) |
| 878 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 879 | UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags"); |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 880 | } |
| 881 | |
| 882 | return vk::BufferView::Create(pAllocator, pCreateInfo, pView); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 883 | } |
| 884 | |
| 885 | VKAPI_ATTR void VKAPI_CALL vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator) |
| 886 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 887 | TRACE("(VkDevice device = %p, VkBufferView bufferView = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | 1424ef6 | 2019-04-05 18:03:53 -0400 | [diff] [blame] | 888 | device, bufferView, pAllocator); |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 889 | |
| 890 | vk::destroy(bufferView, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 891 | } |
| 892 | |
| 893 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage) |
| 894 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 895 | TRACE("(VkDevice device = %p, const VkImageCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkImage* pImage = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 896 | device, pCreateInfo, pAllocator, pImage); |
| 897 | |
Alexis Hetu | f62f375 | 2018-11-15 14:51:15 -0500 | [diff] [blame] | 898 | if(pCreateInfo->pNext) |
| 899 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 900 | UNIMPLEMENTED("pCreateInfo->pNext"); |
Alexis Hetu | f62f375 | 2018-11-15 14:51:15 -0500 | [diff] [blame] | 901 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 902 | |
Alexis Hetu | 0da99f5 | 2019-02-27 12:54:52 -0500 | [diff] [blame] | 903 | vk::Image::CreateInfo imageCreateInfo = |
| 904 | { |
| 905 | pCreateInfo, |
| 906 | device |
| 907 | }; |
| 908 | |
| 909 | return vk::Image::Create(pAllocator, &imageCreateInfo, pImage); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 910 | } |
| 911 | |
| 912 | VKAPI_ATTR void VKAPI_CALL vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator) |
| 913 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 914 | TRACE("(VkDevice device = %p, VkImage image = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 915 | device, image, pAllocator); |
| 916 | |
Alexis Hetu | f62f375 | 2018-11-15 14:51:15 -0500 | [diff] [blame] | 917 | vk::destroy(image, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 918 | } |
| 919 | |
| 920 | VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) |
| 921 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 922 | TRACE("(VkDevice device = %p, VkImage image = %p, const VkImageSubresource* pSubresource = %p, VkSubresourceLayout* pLayout = %p)", |
Alexis Hetu | 1424ef6 | 2019-04-05 18:03:53 -0400 | [diff] [blame] | 923 | device, image, pSubresource, pLayout); |
Alexis Hetu | 6ab37b0 | 2019-01-24 17:02:45 -0500 | [diff] [blame] | 924 | |
| 925 | vk::Cast(image)->getSubresourceLayout(pSubresource, pLayout); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 926 | } |
| 927 | |
| 928 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView) |
| 929 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 930 | TRACE("(VkDevice device = %p, const VkImageViewCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkImageView* pView = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 931 | device, pCreateInfo, pAllocator, pView); |
| 932 | |
Alexis Hetu | 60da158 | 2019-04-05 16:34:38 -0400 | [diff] [blame] | 933 | if(pCreateInfo->flags) |
Alexis Hetu | 9fbaf69 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 934 | { |
Alexis Hetu | 60da158 | 2019-04-05 16:34:38 -0400 | [diff] [blame] | 935 | UNIMPLEMENTED("pCreateInfo->flags"); |
| 936 | } |
| 937 | |
| 938 | const VkBaseInStructure* extensionCreateInfo = reinterpret_cast<const VkBaseInStructure*>(pCreateInfo->pNext); |
| 939 | |
| 940 | while(extensionCreateInfo) |
| 941 | { |
| 942 | switch(extensionCreateInfo->sType) |
| 943 | { |
| 944 | case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR: |
| 945 | { |
| 946 | const VkImageViewUsageCreateInfo* multiviewCreateInfo = reinterpret_cast<const VkImageViewUsageCreateInfo*>(extensionCreateInfo); |
| 947 | ASSERT(!(~vk::Cast(pCreateInfo->image)->getUsage() & multiviewCreateInfo->usage)); |
| 948 | } |
| 949 | break; |
| 950 | case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: |
| 951 | { |
| 952 | const VkSamplerYcbcrConversionInfo* ycbcrConversionInfo = reinterpret_cast<const VkSamplerYcbcrConversionInfo*>(extensionCreateInfo); |
| 953 | if(ycbcrConversionInfo->conversion != VK_NULL_HANDLE) |
| 954 | { |
| 955 | ASSERT((pCreateInfo->components.r == VK_COMPONENT_SWIZZLE_IDENTITY) && |
| 956 | (pCreateInfo->components.g == VK_COMPONENT_SWIZZLE_IDENTITY) && |
| 957 | (pCreateInfo->components.b == VK_COMPONENT_SWIZZLE_IDENTITY) && |
| 958 | (pCreateInfo->components.a == VK_COMPONENT_SWIZZLE_IDENTITY)); |
| 959 | } |
| 960 | } |
| 961 | break; |
| 962 | default: |
| 963 | UNIMPLEMENTED("extensionCreateInfo->sType"); |
| 964 | break; |
| 965 | } |
| 966 | |
| 967 | extensionCreateInfo = extensionCreateInfo->pNext; |
Alexis Hetu | 9fbaf69 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 968 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 969 | |
Alexis Hetu | 9fbaf69 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 970 | return vk::ImageView::Create(pAllocator, pCreateInfo, pView); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 971 | } |
| 972 | |
| 973 | VKAPI_ATTR void VKAPI_CALL vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator) |
| 974 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 975 | TRACE("(VkDevice device = %p, VkImageView imageView = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | 9fbaf69 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 976 | device, imageView, pAllocator); |
| 977 | |
| 978 | vk::destroy(imageView, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 979 | } |
| 980 | |
| 981 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule) |
| 982 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 983 | TRACE("(VkDevice device = %p, const VkShaderModuleCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkShaderModule* pShaderModule = %p)", |
Alexis Hetu | 9fbaf69 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 984 | device, pCreateInfo, pAllocator, pShaderModule); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 985 | |
Alexis Hetu | 259ad3d | 2018-11-15 13:44:31 -0500 | [diff] [blame] | 986 | if(pCreateInfo->pNext || pCreateInfo->flags) |
| 987 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 988 | UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags"); |
Alexis Hetu | 259ad3d | 2018-11-15 13:44:31 -0500 | [diff] [blame] | 989 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 990 | |
Alexis Hetu | 259ad3d | 2018-11-15 13:44:31 -0500 | [diff] [blame] | 991 | return vk::ShaderModule::Create(pAllocator, pCreateInfo, pShaderModule); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 992 | } |
| 993 | |
| 994 | VKAPI_ATTR void VKAPI_CALL vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator) |
| 995 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 996 | TRACE("(VkDevice device = %p, VkShaderModule shaderModule = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | 5174c57 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 997 | device, shaderModule, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 998 | |
Alexis Hetu | 259ad3d | 2018-11-15 13:44:31 -0500 | [diff] [blame] | 999 | vk::destroy(shaderModule, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1000 | } |
| 1001 | |
| 1002 | VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache) |
| 1003 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1004 | TRACE("(VkDevice device = %p, const VkPipelineCacheCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkPipelineCache* pPipelineCache = %p)", |
Alexis Hetu | 1424ef6 | 2019-04-05 18:03:53 -0400 | [diff] [blame] | 1005 | device, pCreateInfo, pAllocator, pPipelineCache); |
Alexis Hetu | 18a8425 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 1006 | |
| 1007 | if(pCreateInfo->pNext || pCreateInfo->flags) |
| 1008 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1009 | UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags"); |
Alexis Hetu | 18a8425 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 1010 | } |
| 1011 | |
| 1012 | return vk::PipelineCache::Create(pAllocator, pCreateInfo, pPipelineCache); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1013 | } |
| 1014 | |
| 1015 | VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator) |
| 1016 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1017 | TRACE("(VkDevice device = %p, VkPipelineCache pipelineCache = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | 1424ef6 | 2019-04-05 18:03:53 -0400 | [diff] [blame] | 1018 | device, pipelineCache, pAllocator); |
Alexis Hetu | 18a8425 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 1019 | |
| 1020 | vk::destroy(pipelineCache, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1021 | } |
| 1022 | |
| 1023 | VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData) |
| 1024 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1025 | TRACE("(VkDevice device = %p, VkPipelineCache pipelineCache = %p, size_t* pDataSize = %p, void* pData = %p)", |
Alexis Hetu | 1424ef6 | 2019-04-05 18:03:53 -0400 | [diff] [blame] | 1026 | device, pipelineCache, pDataSize, pData); |
| 1027 | |
| 1028 | return vk::Cast(pipelineCache)->getData(pDataSize, pData); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1029 | } |
| 1030 | |
| 1031 | VKAPI_ATTR VkResult VKAPI_CALL vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) |
| 1032 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1033 | TRACE("(VkDevice device = %p, VkPipelineCache dstCache = %p, uint32_t srcCacheCount = %d, const VkPipelineCache* pSrcCaches = %p)", |
| 1034 | device, dstCache, int(srcCacheCount), pSrcCaches); |
Alexis Hetu | 1424ef6 | 2019-04-05 18:03:53 -0400 | [diff] [blame] | 1035 | |
| 1036 | return vk::Cast(dstCache)->merge(srcCacheCount, pSrcCaches); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1037 | } |
| 1038 | |
| 1039 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) |
| 1040 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1041 | TRACE("(VkDevice device = %p, VkPipelineCache pipelineCache = %p, uint32_t createInfoCount = %d, const VkGraphicsPipelineCreateInfo* pCreateInfos = %p, const VkAllocationCallbacks* pAllocator = %p, VkPipeline* pPipelines = %p)", |
| 1042 | device, pipelineCache, int(createInfoCount), pCreateInfos, pAllocator, pPipelines); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1043 | |
Alexis Hetu | 85bd613 | 2019-01-29 16:13:17 -0500 | [diff] [blame] | 1044 | // TODO (b/123588002): Optimize based on pipelineCache. |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1045 | |
Alexis Hetu | 000df8b | 2018-10-24 15:22:41 -0400 | [diff] [blame] | 1046 | VkResult errorResult = VK_SUCCESS; |
| 1047 | for(uint32_t i = 0; i < createInfoCount; i++) |
| 1048 | { |
| 1049 | VkResult result = vk::GraphicsPipeline::Create(pAllocator, &pCreateInfos[i], &pPipelines[i]); |
Ben Clayton | f2be26a | 2019-03-08 12:02:05 +0000 | [diff] [blame] | 1050 | if(result == VK_SUCCESS) |
| 1051 | { |
| 1052 | static_cast<vk::GraphicsPipeline*>(vk::Cast(pPipelines[i]))->compileShaders(pAllocator, &pCreateInfos[i]); |
| 1053 | } |
| 1054 | else |
Alexis Hetu | 000df8b | 2018-10-24 15:22:41 -0400 | [diff] [blame] | 1055 | { |
| 1056 | // According to the Vulkan spec, section 9.4. Multiple Pipeline Creation |
| 1057 | // "When an application attempts to create many pipelines in a single command, |
| 1058 | // it is possible that some subset may fail creation. In that case, the |
| 1059 | // corresponding entries in the pPipelines output array will be filled with |
| 1060 | // VK_NULL_HANDLE values. If any pipeline fails creation (for example, due to |
| 1061 | // out of memory errors), the vkCreate*Pipelines commands will return an |
| 1062 | // error code. The implementation will attempt to create all pipelines, and |
| 1063 | // only return VK_NULL_HANDLE values for those that actually failed." |
| 1064 | pPipelines[i] = VK_NULL_HANDLE; |
| 1065 | errorResult = result; |
| 1066 | } |
| 1067 | } |
| 1068 | |
| 1069 | return errorResult; |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1070 | } |
| 1071 | |
| 1072 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) |
| 1073 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1074 | TRACE("(VkDevice device = %p, VkPipelineCache pipelineCache = %p, uint32_t createInfoCount = %d, const VkComputePipelineCreateInfo* pCreateInfos = %p, const VkAllocationCallbacks* pAllocator = %p, VkPipeline* pPipelines = %p)", |
| 1075 | device, pipelineCache, int(createInfoCount), pCreateInfos, pAllocator, pPipelines); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1076 | |
Alexis Hetu | 85bd613 | 2019-01-29 16:13:17 -0500 | [diff] [blame] | 1077 | // TODO (b/123588002): Optimize based on pipelineCache. |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1078 | |
Alexis Hetu | 000df8b | 2018-10-24 15:22:41 -0400 | [diff] [blame] | 1079 | VkResult errorResult = VK_SUCCESS; |
| 1080 | for(uint32_t i = 0; i < createInfoCount; i++) |
| 1081 | { |
| 1082 | VkResult result = vk::ComputePipeline::Create(pAllocator, &pCreateInfos[i], &pPipelines[i]); |
Ben Clayton | f2be26a | 2019-03-08 12:02:05 +0000 | [diff] [blame] | 1083 | if(result == VK_SUCCESS) |
| 1084 | { |
| 1085 | static_cast<vk::ComputePipeline*>(vk::Cast(pPipelines[i]))->compileShaders(pAllocator, &pCreateInfos[i]); |
| 1086 | } |
| 1087 | else |
Alexis Hetu | 000df8b | 2018-10-24 15:22:41 -0400 | [diff] [blame] | 1088 | { |
| 1089 | // According to the Vulkan spec, section 9.4. Multiple Pipeline Creation |
| 1090 | // "When an application attempts to create many pipelines in a single command, |
| 1091 | // it is possible that some subset may fail creation. In that case, the |
| 1092 | // corresponding entries in the pPipelines output array will be filled with |
| 1093 | // VK_NULL_HANDLE values. If any pipeline fails creation (for example, due to |
| 1094 | // out of memory errors), the vkCreate*Pipelines commands will return an |
| 1095 | // error code. The implementation will attempt to create all pipelines, and |
| 1096 | // only return VK_NULL_HANDLE values for those that actually failed." |
| 1097 | pPipelines[i] = VK_NULL_HANDLE; |
| 1098 | errorResult = result; |
| 1099 | } |
| 1100 | } |
| 1101 | |
| 1102 | return errorResult; |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1103 | } |
| 1104 | |
| 1105 | VKAPI_ATTR void VKAPI_CALL vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator) |
| 1106 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1107 | TRACE("(VkDevice device = %p, VkPipeline pipeline = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1108 | device, pipeline, pAllocator); |
| 1109 | |
Alexis Hetu | 000df8b | 2018-10-24 15:22:41 -0400 | [diff] [blame] | 1110 | vk::destroy(pipeline, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1111 | } |
| 1112 | |
| 1113 | VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout) |
| 1114 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1115 | TRACE("(VkDevice device = %p, const VkPipelineLayoutCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkPipelineLayout* pPipelineLayout = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1116 | device, pCreateInfo, pAllocator, pPipelineLayout); |
| 1117 | |
Alexis Hetu | 000df8b | 2018-10-24 15:22:41 -0400 | [diff] [blame] | 1118 | if(pCreateInfo->pNext || pCreateInfo->flags) |
| 1119 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1120 | UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags"); |
Alexis Hetu | 000df8b | 2018-10-24 15:22:41 -0400 | [diff] [blame] | 1121 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1122 | |
Alexis Hetu | 000df8b | 2018-10-24 15:22:41 -0400 | [diff] [blame] | 1123 | return vk::PipelineLayout::Create(pAllocator, pCreateInfo, pPipelineLayout); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1124 | } |
| 1125 | |
| 1126 | VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator) |
| 1127 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1128 | TRACE("(VkDevice device = %p, VkPipelineLayout pipelineLayout = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1129 | device, pipelineLayout, pAllocator); |
| 1130 | |
Alexis Hetu | 000df8b | 2018-10-24 15:22:41 -0400 | [diff] [blame] | 1131 | vk::destroy(pipelineLayout, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1132 | } |
| 1133 | |
| 1134 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler) |
| 1135 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1136 | TRACE("(VkDevice device = %p, const VkSamplerCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkSampler* pSampler = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1137 | device, pCreateInfo, pAllocator, pSampler); |
| 1138 | |
Alexis Hetu | 5174c57 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 1139 | if(pCreateInfo->pNext || pCreateInfo->flags) |
| 1140 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1141 | UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags"); |
Alexis Hetu | 5174c57 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 1142 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1143 | |
Alexis Hetu | 5174c57 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 1144 | return vk::Sampler::Create(pAllocator, pCreateInfo, pSampler); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1145 | } |
| 1146 | |
| 1147 | VKAPI_ATTR void VKAPI_CALL vkDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator) |
| 1148 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1149 | TRACE("(VkDevice device = %p, VkSampler sampler = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1150 | device, sampler, pAllocator); |
| 1151 | |
Alexis Hetu | 5174c57 | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 1152 | vk::destroy(sampler, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1153 | } |
| 1154 | |
| 1155 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout) |
| 1156 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1157 | TRACE("(VkDevice device = %p, const VkDescriptorSetLayoutCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkDescriptorSetLayout* pSetLayout = %p)", |
Alexis Hetu | c817663 | 2019-01-22 17:01:28 -0500 | [diff] [blame] | 1158 | device, pCreateInfo, pAllocator, pSetLayout); |
| 1159 | |
| 1160 | if(pCreateInfo->pNext) |
| 1161 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1162 | UNIMPLEMENTED("pCreateInfo->pNext"); |
Alexis Hetu | c817663 | 2019-01-22 17:01:28 -0500 | [diff] [blame] | 1163 | } |
| 1164 | |
| 1165 | return vk::DescriptorSetLayout::Create(pAllocator, pCreateInfo, pSetLayout); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1166 | } |
| 1167 | |
| 1168 | VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator) |
| 1169 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1170 | TRACE("(VkDevice device = %p, VkDescriptorSetLayout descriptorSetLayout = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | c817663 | 2019-01-22 17:01:28 -0500 | [diff] [blame] | 1171 | device, descriptorSetLayout, pAllocator); |
| 1172 | |
| 1173 | vk::destroy(descriptorSetLayout, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1174 | } |
| 1175 | |
| 1176 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool) |
| 1177 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1178 | TRACE("(VkDevice device = %p, const VkDescriptorPoolCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkDescriptorPool* pDescriptorPool = %p)", |
Alexis Hetu | c817663 | 2019-01-22 17:01:28 -0500 | [diff] [blame] | 1179 | device, pCreateInfo, pAllocator, pDescriptorPool); |
| 1180 | |
| 1181 | if(pCreateInfo->pNext) |
| 1182 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1183 | UNIMPLEMENTED("pCreateInfo->pNext"); |
Alexis Hetu | c817663 | 2019-01-22 17:01:28 -0500 | [diff] [blame] | 1184 | } |
| 1185 | |
| 1186 | return vk::DescriptorPool::Create(pAllocator, pCreateInfo, pDescriptorPool); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1187 | } |
| 1188 | |
| 1189 | VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator) |
| 1190 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1191 | TRACE("(VkDevice device = %p, VkDescriptorPool descriptorPool = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | c817663 | 2019-01-22 17:01:28 -0500 | [diff] [blame] | 1192 | device, descriptorPool, pAllocator); |
| 1193 | |
| 1194 | vk::destroy(descriptorPool, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1195 | } |
| 1196 | |
| 1197 | VKAPI_ATTR VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) |
| 1198 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1199 | TRACE("(VkDevice device = %p, VkDescriptorPool descriptorPool = %p, VkDescriptorPoolResetFlags flags = 0x%x)", |
| 1200 | device, descriptorPool, int(flags)); |
Alexis Hetu | c817663 | 2019-01-22 17:01:28 -0500 | [diff] [blame] | 1201 | |
| 1202 | if(flags) |
| 1203 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1204 | UNIMPLEMENTED("flags"); |
Alexis Hetu | c817663 | 2019-01-22 17:01:28 -0500 | [diff] [blame] | 1205 | } |
| 1206 | |
| 1207 | return vk::Cast(descriptorPool)->reset(); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1208 | } |
| 1209 | |
| 1210 | VKAPI_ATTR VkResult VKAPI_CALL vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets) |
| 1211 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1212 | TRACE("(VkDevice device = %p, const VkDescriptorSetAllocateInfo* pAllocateInfo = %p, VkDescriptorSet* pDescriptorSets = %p)", |
Alexis Hetu | c817663 | 2019-01-22 17:01:28 -0500 | [diff] [blame] | 1213 | device, pAllocateInfo, pDescriptorSets); |
| 1214 | |
| 1215 | if(pAllocateInfo->pNext) |
| 1216 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1217 | UNIMPLEMENTED("pAllocateInfo->pNext"); |
Alexis Hetu | c817663 | 2019-01-22 17:01:28 -0500 | [diff] [blame] | 1218 | } |
| 1219 | |
| 1220 | return vk::Cast(pAllocateInfo->descriptorPool)->allocateSets( |
| 1221 | pAllocateInfo->descriptorSetCount, pAllocateInfo->pSetLayouts, pDescriptorSets); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1222 | } |
| 1223 | |
| 1224 | VKAPI_ATTR VkResult VKAPI_CALL vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets) |
| 1225 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1226 | TRACE("(VkDevice device = %p, VkDescriptorPool descriptorPool = %p, uint32_t descriptorSetCount = %d, const VkDescriptorSet* pDescriptorSets = %p)", |
Alexis Hetu | c817663 | 2019-01-22 17:01:28 -0500 | [diff] [blame] | 1227 | device, descriptorPool, descriptorSetCount, pDescriptorSets); |
| 1228 | |
| 1229 | vk::Cast(descriptorPool)->freeSets(descriptorSetCount, pDescriptorSets); |
| 1230 | |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1231 | return VK_SUCCESS; |
| 1232 | } |
| 1233 | |
| 1234 | VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies) |
| 1235 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1236 | TRACE("(VkDevice device = %p, uint32_t descriptorWriteCount = %d, const VkWriteDescriptorSet* pDescriptorWrites = %p, uint32_t descriptorCopyCount = %d, const VkCopyDescriptorSet* pDescriptorCopies = %p)", |
Alexis Hetu | 048974f | 2019-02-15 15:28:37 -0500 | [diff] [blame] | 1237 | device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies); |
| 1238 | |
| 1239 | vk::Cast(device)->updateDescriptorSets(descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1240 | } |
| 1241 | |
| 1242 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer) |
| 1243 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1244 | TRACE("(VkDevice device = %p, const VkFramebufferCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkFramebuffer* pFramebuffer = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1245 | device, pCreateInfo, pAllocator, pFramebuffer); |
| 1246 | |
Alexis Hetu | 8f631c8 | 2018-11-15 15:11:36 -0500 | [diff] [blame] | 1247 | if(pCreateInfo->pNext || pCreateInfo->flags) |
| 1248 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1249 | UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags"); |
Alexis Hetu | 8f631c8 | 2018-11-15 15:11:36 -0500 | [diff] [blame] | 1250 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1251 | |
Alexis Hetu | 8f631c8 | 2018-11-15 15:11:36 -0500 | [diff] [blame] | 1252 | return vk::Framebuffer::Create(pAllocator, pCreateInfo, pFramebuffer); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1253 | } |
| 1254 | |
| 1255 | VKAPI_ATTR void VKAPI_CALL vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator) |
| 1256 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1257 | TRACE("(VkDevice device = %p, VkFramebuffer framebuffer = %p, const VkAllocationCallbacks* pAllocator = %p)", |
| 1258 | device, framebuffer, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1259 | |
Alexis Hetu | 8f631c8 | 2018-11-15 15:11:36 -0500 | [diff] [blame] | 1260 | vk::destroy(framebuffer, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1261 | } |
| 1262 | |
| 1263 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) |
| 1264 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1265 | TRACE("(VkDevice device = %p, const VkRenderPassCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkRenderPass* pRenderPass = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1266 | device, pCreateInfo, pAllocator, pRenderPass); |
| 1267 | |
Alexis Hetu | 67806a1 | 2019-04-05 14:12:27 -0400 | [diff] [blame] | 1268 | if(pCreateInfo->flags) |
Alexis Hetu | b16f989 | 2018-11-15 15:18:41 -0500 | [diff] [blame] | 1269 | { |
Alexis Hetu | 67806a1 | 2019-04-05 14:12:27 -0400 | [diff] [blame] | 1270 | UNIMPLEMENTED("pCreateInfo->flags"); |
| 1271 | } |
| 1272 | |
| 1273 | const VkBaseInStructure* extensionCreateInfo = reinterpret_cast<const VkBaseInStructure*>(pCreateInfo->pNext); |
| 1274 | |
| 1275 | while(extensionCreateInfo) |
| 1276 | { |
| 1277 | switch(extensionCreateInfo->sType) |
| 1278 | { |
| 1279 | case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: |
| 1280 | { |
| 1281 | const VkRenderPassInputAttachmentAspectCreateInfo* inputAttachmentAspectCreateInfo = reinterpret_cast<const VkRenderPassInputAttachmentAspectCreateInfo*>(extensionCreateInfo); |
| 1282 | |
| 1283 | for(uint32_t i = 0; i < inputAttachmentAspectCreateInfo->aspectReferenceCount; i++) |
| 1284 | { |
| 1285 | const VkInputAttachmentAspectReference& aspectReference = inputAttachmentAspectCreateInfo->pAspectReferences[i]; |
| 1286 | ASSERT(aspectReference.subpass < pCreateInfo->subpassCount); |
| 1287 | const VkSubpassDescription& subpassDescription = pCreateInfo->pSubpasses[aspectReference.subpass]; |
| 1288 | ASSERT(aspectReference.inputAttachmentIndex < subpassDescription.inputAttachmentCount); |
| 1289 | const VkAttachmentReference& attachmentReference = subpassDescription.pInputAttachments[aspectReference.inputAttachmentIndex]; |
| 1290 | if(attachmentReference.attachment != VK_ATTACHMENT_UNUSED) |
| 1291 | { |
| 1292 | // If the pNext chain includes an instance of VkRenderPassInputAttachmentAspectCreateInfo, for any |
| 1293 | // element of the pInputAttachments member of any element of pSubpasses where the attachment member |
| 1294 | // is not VK_ATTACHMENT_UNUSED, the aspectMask member of the corresponding element of |
| 1295 | // VkRenderPassInputAttachmentAspectCreateInfo::pAspectReferences must only include aspects that are |
| 1296 | // present in images of the format specified by the element of pAttachments at attachment |
| 1297 | vk::Format format(pCreateInfo->pAttachments[attachmentReference.attachment].format); |
| 1298 | bool isDepth = format.isDepth(); |
| 1299 | bool isStencil = format.isStencil(); |
| 1300 | ASSERT(!(aspectReference.aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) || (!isDepth && !isStencil)); |
| 1301 | ASSERT(!(aspectReference.aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT) || isDepth); |
| 1302 | ASSERT(!(aspectReference.aspectMask & VK_IMAGE_ASPECT_STENCIL_BIT) || isStencil); |
| 1303 | } |
| 1304 | } |
| 1305 | } |
| 1306 | break; |
| 1307 | case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: |
| 1308 | { |
| 1309 | const VkRenderPassMultiviewCreateInfo* multiviewCreateInfo = reinterpret_cast<const VkRenderPassMultiviewCreateInfo*>(extensionCreateInfo); |
| 1310 | ASSERT((multiviewCreateInfo->subpassCount == 0) || (multiviewCreateInfo->subpassCount == pCreateInfo->subpassCount)); |
| 1311 | ASSERT((multiviewCreateInfo->dependencyCount == 0) || (multiviewCreateInfo->dependencyCount == pCreateInfo->dependencyCount)); |
| 1312 | |
| 1313 | bool zeroMask = (multiviewCreateInfo->pViewMasks[0] == 0); |
| 1314 | for(uint32_t i = 1; i < multiviewCreateInfo->subpassCount; i++) |
| 1315 | { |
| 1316 | ASSERT((multiviewCreateInfo->pViewMasks[i] == 0) == zeroMask); |
| 1317 | } |
| 1318 | |
| 1319 | if(zeroMask) |
| 1320 | { |
| 1321 | ASSERT(multiviewCreateInfo->correlationMaskCount == 0); |
| 1322 | } |
| 1323 | |
| 1324 | for(uint32_t i = 0; i < multiviewCreateInfo->dependencyCount; i++) |
| 1325 | { |
| 1326 | const VkSubpassDependency &dependency = pCreateInfo->pDependencies[i]; |
| 1327 | if(multiviewCreateInfo->pViewOffsets[i] != 0) |
| 1328 | { |
| 1329 | ASSERT(dependency.srcSubpass != dependency.dstSubpass); |
| 1330 | ASSERT(dependency.dependencyFlags & VK_DEPENDENCY_VIEW_LOCAL_BIT); |
| 1331 | } |
| 1332 | if(zeroMask) |
| 1333 | { |
| 1334 | ASSERT(!(dependency.dependencyFlags & VK_DEPENDENCY_VIEW_LOCAL_BIT)); |
| 1335 | } |
| 1336 | } |
| 1337 | |
| 1338 | // If the pNext chain includes an instance of VkRenderPassMultiviewCreateInfo, |
| 1339 | // each element of its pViewMask member must not include a bit at a position |
| 1340 | // greater than the value of VkPhysicalDeviceLimits::maxFramebufferLayers |
| 1341 | // pViewMask is a 32 bit value. If maxFramebufferLayers > 32, it's impossible |
| 1342 | // for pViewMask to contain a bit at an illegal position |
| 1343 | // Note: Verify pViewMask values instead if we hit this assert |
| 1344 | ASSERT(vk::Cast(vk::Cast(device)->getPhysicalDevice())->getProperties().limits.maxFramebufferLayers >= 32); |
| 1345 | } |
| 1346 | break; |
| 1347 | default: |
| 1348 | UNIMPLEMENTED("extensionCreateInfo->sType"); |
| 1349 | break; |
| 1350 | } |
| 1351 | |
| 1352 | extensionCreateInfo = extensionCreateInfo->pNext; |
Alexis Hetu | b16f989 | 2018-11-15 15:18:41 -0500 | [diff] [blame] | 1353 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1354 | |
Alexis Hetu | b16f989 | 2018-11-15 15:18:41 -0500 | [diff] [blame] | 1355 | return vk::RenderPass::Create(pAllocator, pCreateInfo, pRenderPass); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1356 | } |
| 1357 | |
| 1358 | VKAPI_ATTR void VKAPI_CALL vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator) |
| 1359 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1360 | TRACE("(VkDevice device = %p, VkRenderPass renderPass = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1361 | device, renderPass, pAllocator); |
| 1362 | |
Alexis Hetu | b16f989 | 2018-11-15 15:18:41 -0500 | [diff] [blame] | 1363 | vk::destroy(renderPass, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1364 | } |
| 1365 | |
| 1366 | VKAPI_ATTR void VKAPI_CALL vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) |
| 1367 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1368 | TRACE("(VkDevice device = %p, VkRenderPass renderPass = %p, VkExtent2D* pGranularity = %p)", |
Hernan Liatis | c7943e9 | 2019-02-25 19:29:54 -0800 | [diff] [blame] | 1369 | device, renderPass, pGranularity); |
| 1370 | |
Alexis Hetu | 6d74ab8 | 2019-02-15 14:42:38 -0500 | [diff] [blame] | 1371 | vk::Cast(renderPass)->getRenderAreaGranularity(pGranularity); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1372 | } |
| 1373 | |
| 1374 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool) |
| 1375 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1376 | TRACE("(VkDevice device = %p, const VkCommandPoolCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkCommandPool* pCommandPool = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1377 | device, pCreateInfo, pAllocator, pCommandPool); |
| 1378 | |
Alexis Hetu | 9c4ecae | 2018-11-20 16:26:10 -0500 | [diff] [blame] | 1379 | if(pCreateInfo->pNext) |
| 1380 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1381 | UNIMPLEMENTED("pCreateInfo->pNext"); |
Alexis Hetu | 9c4ecae | 2018-11-20 16:26:10 -0500 | [diff] [blame] | 1382 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1383 | |
Alexis Hetu | 9c4ecae | 2018-11-20 16:26:10 -0500 | [diff] [blame] | 1384 | return vk::CommandPool::Create(pAllocator, pCreateInfo, pCommandPool); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1385 | } |
| 1386 | |
| 1387 | VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator) |
| 1388 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1389 | TRACE("(VkDevice device = %p, VkCommandPool commandPool = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1390 | device, commandPool, pAllocator); |
| 1391 | |
Alexis Hetu | 9c4ecae | 2018-11-20 16:26:10 -0500 | [diff] [blame] | 1392 | vk::destroy(commandPool, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1393 | } |
| 1394 | |
| 1395 | VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) |
| 1396 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1397 | TRACE("(VkDevice device = %p, VkCommandPool commandPool = %p, VkCommandPoolResetFlags flags = %d)", |
| 1398 | device, commandPool, int(flags)); |
Alexis Hetu | cd610c9 | 2019-02-01 16:47:51 -0500 | [diff] [blame] | 1399 | |
| 1400 | return vk::Cast(commandPool)->reset(flags); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1401 | } |
| 1402 | |
| 1403 | VKAPI_ATTR VkResult VKAPI_CALL vkAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers) |
| 1404 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1405 | TRACE("(VkDevice device = %p, const VkCommandBufferAllocateInfo* pAllocateInfo = %p, VkCommandBuffer* pCommandBuffers = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1406 | device, pAllocateInfo, pCommandBuffers); |
| 1407 | |
Alexis Hetu | bffee5e | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 1408 | if(pAllocateInfo->pNext) |
| 1409 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1410 | UNIMPLEMENTED("pAllocateInfo->pNext"); |
Alexis Hetu | bffee5e | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 1411 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1412 | |
Alexis Hetu | bffee5e | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 1413 | return vk::Cast(pAllocateInfo->commandPool)->allocateCommandBuffers( |
| 1414 | pAllocateInfo->level, pAllocateInfo->commandBufferCount, pCommandBuffers); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1415 | } |
| 1416 | |
| 1417 | VKAPI_ATTR void VKAPI_CALL vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers) |
| 1418 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1419 | TRACE("(VkDevice device = %p, VkCommandPool commandPool = %p, uint32_t commandBufferCount = %d, const VkCommandBuffer* pCommandBuffers = %p)", |
| 1420 | device, commandPool, int(commandBufferCount), pCommandBuffers); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1421 | |
Alexis Hetu | bffee5e | 2018-11-19 11:30:43 -0500 | [diff] [blame] | 1422 | vk::Cast(commandPool)->freeCommandBuffers(commandBufferCount, pCommandBuffers); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1423 | } |
| 1424 | |
| 1425 | VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo) |
| 1426 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1427 | TRACE("(VkCommandBuffer commandBuffer = %p, const VkCommandBufferBeginInfo* pBeginInfo = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1428 | commandBuffer, pBeginInfo); |
| 1429 | |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1430 | if(pBeginInfo->pNext) |
| 1431 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1432 | UNIMPLEMENTED("pBeginInfo->pNext"); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1433 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1434 | |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1435 | return vk::Cast(commandBuffer)->begin(pBeginInfo->flags, pBeginInfo->pInheritanceInfo); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1436 | } |
| 1437 | |
| 1438 | VKAPI_ATTR VkResult VKAPI_CALL vkEndCommandBuffer(VkCommandBuffer commandBuffer) |
| 1439 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1440 | TRACE("(VkCommandBuffer commandBuffer = %p)", commandBuffer); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1441 | |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1442 | return vk::Cast(commandBuffer)->end(); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1443 | } |
| 1444 | |
| 1445 | VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) |
| 1446 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1447 | TRACE("VkCommandBuffer commandBuffer = %p, VkCommandBufferResetFlags flags = %d", commandBuffer, int(flags)); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1448 | |
| 1449 | return vk::Cast(commandBuffer)->reset(flags); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1450 | } |
| 1451 | |
| 1452 | VKAPI_ATTR void VKAPI_CALL vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) |
| 1453 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1454 | TRACE("(VkCommandBuffer commandBuffer = %p, VkPipelineBindPoint pipelineBindPoint = %d, VkPipeline pipeline = %p)", |
| 1455 | commandBuffer, int(pipelineBindPoint), pipeline); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1456 | |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1457 | vk::Cast(commandBuffer)->bindPipeline(pipelineBindPoint, pipeline); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1458 | } |
| 1459 | |
| 1460 | VKAPI_ATTR void VKAPI_CALL vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports) |
| 1461 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1462 | TRACE("(VkCommandBuffer commandBuffer = %p, uint32_t firstViewport = %d, uint32_t viewportCount = %d, const VkViewport* pViewports = %p)", |
| 1463 | commandBuffer, int(firstViewport), int(viewportCount), pViewports); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1464 | |
| 1465 | vk::Cast(commandBuffer)->setViewport(firstViewport, viewportCount, pViewports); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1466 | } |
| 1467 | |
| 1468 | VKAPI_ATTR void VKAPI_CALL vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors) |
| 1469 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1470 | TRACE("(VkCommandBuffer commandBuffer = %p, uint32_t firstScissor = %d, uint32_t scissorCount = %d, const VkRect2D* pScissors = %p)", |
| 1471 | commandBuffer, int(firstScissor), int(scissorCount), pScissors); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1472 | |
| 1473 | vk::Cast(commandBuffer)->setScissor(firstScissor, scissorCount, pScissors); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1474 | } |
| 1475 | |
| 1476 | VKAPI_ATTR void VKAPI_CALL vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) |
| 1477 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1478 | TRACE("(VkCommandBuffer commandBuffer = %p, float lineWidth = %f)", commandBuffer, lineWidth); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1479 | |
| 1480 | vk::Cast(commandBuffer)->setLineWidth(lineWidth); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1481 | } |
| 1482 | |
| 1483 | VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor) |
| 1484 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1485 | TRACE("(VkCommandBuffer commandBuffer = %p, float depthBiasConstantFactor = %f, float depthBiasClamp = %f, float depthBiasSlopeFactor = %f)", |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1486 | commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor); |
| 1487 | |
| 1488 | vk::Cast(commandBuffer)->setDepthBias(depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1489 | } |
| 1490 | |
| 1491 | VKAPI_ATTR void VKAPI_CALL vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) |
| 1492 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1493 | TRACE("(VkCommandBuffer commandBuffer = %p, const float blendConstants[4] = {%f, %f, %f, %f})", |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1494 | commandBuffer, blendConstants[0], blendConstants[1], blendConstants[2], blendConstants[3]); |
| 1495 | |
| 1496 | vk::Cast(commandBuffer)->setBlendConstants(blendConstants); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1497 | } |
| 1498 | |
| 1499 | VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds) |
| 1500 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1501 | TRACE("(VkCommandBuffer commandBuffer = %p, float minDepthBounds = %f, float maxDepthBounds = %f)", |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1502 | commandBuffer, minDepthBounds, maxDepthBounds); |
| 1503 | |
| 1504 | vk::Cast(commandBuffer)->setDepthBounds(minDepthBounds, maxDepthBounds); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1505 | } |
| 1506 | |
| 1507 | VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask) |
| 1508 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1509 | TRACE("(VkCommandBuffer commandBuffer = %p, VkStencilFaceFlags faceMask = %d, uint32_t compareMask = %d)", |
| 1510 | commandBuffer, int(faceMask), int(compareMask)); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1511 | |
| 1512 | vk::Cast(commandBuffer)->setStencilCompareMask(faceMask, compareMask); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1513 | } |
| 1514 | |
| 1515 | VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask) |
| 1516 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1517 | TRACE("(VkCommandBuffer commandBuffer = %p, VkStencilFaceFlags faceMask = %d, uint32_t writeMask = %d)", |
| 1518 | commandBuffer, int(faceMask), int(writeMask)); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1519 | |
| 1520 | vk::Cast(commandBuffer)->setStencilWriteMask(faceMask, writeMask); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1521 | } |
| 1522 | |
| 1523 | VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference) |
| 1524 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1525 | TRACE("(VkCommandBuffer commandBuffer = %p, VkStencilFaceFlags faceMask = %d, uint32_t reference = %d)", |
| 1526 | commandBuffer, int(faceMask), int(reference)); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1527 | |
| 1528 | vk::Cast(commandBuffer)->setStencilReference(faceMask, reference); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1529 | } |
| 1530 | |
| 1531 | VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) |
| 1532 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1533 | TRACE("(VkCommandBuffer commandBuffer = %p, VkPipelineBindPoint pipelineBindPoint = %d, VkPipelineLayout layout = %p, uint32_t firstSet = %d, uint32_t descriptorSetCount = %d, const VkDescriptorSet* pDescriptorSets = %p, uint32_t dynamicOffsetCount = %d, const uint32_t* pDynamicOffsets = %p)", |
| 1534 | commandBuffer, int(pipelineBindPoint), layout, int(firstSet), int(descriptorSetCount), pDescriptorSets, int(dynamicOffsetCount), pDynamicOffsets); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1535 | |
| 1536 | vk::Cast(commandBuffer)->bindDescriptorSets(pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1537 | } |
| 1538 | |
| 1539 | VKAPI_ATTR void VKAPI_CALL vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) |
| 1540 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1541 | TRACE("(VkCommandBuffer commandBuffer = %p, VkBuffer buffer = %p, VkDeviceSize offset = %d, VkIndexType indexType = %d)", |
| 1542 | commandBuffer, buffer, int(offset), int(indexType)); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1543 | |
| 1544 | vk::Cast(commandBuffer)->bindIndexBuffer(buffer, offset, indexType); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1545 | } |
| 1546 | |
| 1547 | VKAPI_ATTR void VKAPI_CALL vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) |
| 1548 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1549 | TRACE("(VkCommandBuffer commandBuffer = %p, uint32_t firstBinding = %d, uint32_t bindingCount = %d, const VkBuffer* pBuffers = %p, const VkDeviceSize* pOffsets = %p)", |
| 1550 | commandBuffer, int(firstBinding), int(bindingCount), pBuffers, pOffsets); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1551 | |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1552 | vk::Cast(commandBuffer)->bindVertexBuffers(firstBinding, bindingCount, pBuffers, pOffsets); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1553 | } |
| 1554 | |
| 1555 | VKAPI_ATTR void VKAPI_CALL vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) |
| 1556 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1557 | TRACE("(VkCommandBuffer commandBuffer = %p, uint32_t vertexCount = %d, uint32_t instanceCount = %d, uint32_t firstVertex = %d, uint32_t firstInstance = %d)", |
| 1558 | commandBuffer, int(vertexCount), int(instanceCount), int(firstVertex), int(firstInstance)); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1559 | |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1560 | vk::Cast(commandBuffer)->draw(vertexCount, instanceCount, firstVertex, firstInstance); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1561 | } |
| 1562 | |
| 1563 | VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) |
| 1564 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1565 | TRACE("(VkCommandBuffer commandBuffer = %p, uint32_t indexCount = %d, uint32_t instanceCount = %d, uint32_t firstIndex = %d, int32_t vertexOffset = %d, uint32_t firstInstance = %d)", |
| 1566 | commandBuffer, int(indexCount), int(instanceCount), int(firstIndex), int(vertexOffset), int(firstInstance)); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1567 | |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1568 | vk::Cast(commandBuffer)->drawIndexed(indexCount, instanceCount, firstIndex, vertexOffset, firstInstance); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1569 | } |
| 1570 | |
| 1571 | VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) |
| 1572 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1573 | TRACE("(VkCommandBuffer commandBuffer = %p, VkBuffer buffer = %p, VkDeviceSize offset = %d, uint32_t drawCount = %d, uint32_t stride = %d)", |
| 1574 | commandBuffer, buffer, int(offset), int(drawCount), int(stride)); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1575 | |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1576 | vk::Cast(commandBuffer)->drawIndirect(buffer, offset, drawCount, stride); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1577 | } |
| 1578 | |
| 1579 | VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) |
| 1580 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1581 | TRACE("(VkCommandBuffer commandBuffer = %p, VkBuffer buffer = %p, VkDeviceSize offset = %d, uint32_t drawCount = %d, uint32_t stride = %d)", |
| 1582 | commandBuffer, buffer, int(offset), int(drawCount), int(stride)); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1583 | |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1584 | vk::Cast(commandBuffer)->drawIndexedIndirect(buffer, offset, drawCount, stride); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1585 | } |
| 1586 | |
| 1587 | VKAPI_ATTR void VKAPI_CALL vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) |
| 1588 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1589 | TRACE("(VkCommandBuffer commandBuffer = %p, uint32_t groupCountX = %d, uint32_t groupCountY = %d, uint32_t groupCountZ = %d)", |
| 1590 | commandBuffer, int(groupCountX), int(groupCountY), int(groupCountZ)); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1591 | |
| 1592 | vk::Cast(commandBuffer)->dispatch(groupCountX, groupCountY, groupCountZ); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1593 | } |
| 1594 | |
| 1595 | VKAPI_ATTR void VKAPI_CALL vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) |
| 1596 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1597 | TRACE("(VkCommandBuffer commandBuffer = %p, VkBuffer buffer = %p, VkDeviceSize offset = %d)", |
| 1598 | commandBuffer, buffer, int(offset)); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1599 | |
| 1600 | vk::Cast(commandBuffer)->dispatchIndirect(buffer, offset); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1601 | } |
| 1602 | |
| 1603 | VKAPI_ATTR void VKAPI_CALL vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) |
| 1604 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1605 | TRACE("(VkCommandBuffer commandBuffer = %p, VkBuffer srcBuffer = %p, VkBuffer dstBuffer = %p, uint32_t regionCount = %d, const VkBufferCopy* pRegions = %p)", |
| 1606 | commandBuffer, srcBuffer, dstBuffer, int(regionCount), pRegions); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1607 | |
| 1608 | vk::Cast(commandBuffer)->copyBuffer(srcBuffer, dstBuffer, regionCount, pRegions); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1609 | } |
| 1610 | |
| 1611 | VKAPI_ATTR void VKAPI_CALL vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) |
| 1612 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1613 | TRACE("(VkCommandBuffer commandBuffer = %p, VkImage srcImage = %p, VkImageLayout srcImageLayout = %d, VkImage dstImage = %p, VkImageLayout dstImageLayout = %d, uint32_t regionCount = %d, const VkImageCopy* pRegions = %p)", |
| 1614 | commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, int(regionCount), pRegions); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1615 | |
| 1616 | vk::Cast(commandBuffer)->copyImage(srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1617 | } |
| 1618 | |
| 1619 | VKAPI_ATTR void VKAPI_CALL vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter) |
| 1620 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1621 | TRACE("(VkCommandBuffer commandBuffer = %p, VkImage srcImage = %p, VkImageLayout srcImageLayout = %d, VkImage dstImage = %p, VkImageLayout dstImageLayout = %d, uint32_t regionCount = %d, const VkImageBlit* pRegions = %p, VkFilter filter = %d)", |
| 1622 | commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, int(regionCount), pRegions, filter); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1623 | |
| 1624 | vk::Cast(commandBuffer)->blitImage(srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1625 | } |
| 1626 | |
| 1627 | VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) |
| 1628 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1629 | TRACE("(VkCommandBuffer commandBuffer = %p, VkBuffer srcBuffer = %p, VkImage dstImage = %p, VkImageLayout dstImageLayout = %d, uint32_t regionCount = %d, const VkBufferImageCopy* pRegions = %p)", |
| 1630 | commandBuffer, srcBuffer, dstImage, dstImageLayout, int(regionCount), pRegions); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1631 | |
| 1632 | vk::Cast(commandBuffer)->copyBufferToImage(srcBuffer, dstImage, dstImageLayout, regionCount, pRegions); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1633 | } |
| 1634 | |
| 1635 | VKAPI_ATTR void VKAPI_CALL vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) |
| 1636 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1637 | TRACE("(VkCommandBuffer commandBuffer = %p, VkImage srcImage = %p, VkImageLayout srcImageLayout = %d, VkBuffer dstBuffer = %p, uint32_t regionCount = %d, const VkBufferImageCopy* pRegions = %p)", |
| 1638 | commandBuffer, srcImage, int(srcImageLayout), dstBuffer, int(regionCount), pRegions); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1639 | |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1640 | vk::Cast(commandBuffer)->copyImageToBuffer(srcImage, srcImageLayout, dstBuffer, regionCount, pRegions); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1641 | } |
| 1642 | |
| 1643 | VKAPI_ATTR void VKAPI_CALL vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData) |
| 1644 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1645 | TRACE("(VkCommandBuffer commandBuffer = %p, VkBuffer dstBuffer = %p, VkDeviceSize dstOffset = %d, VkDeviceSize dataSize = %d, const void* pData = %p)", |
| 1646 | commandBuffer, dstBuffer, int(dstOffset), int(dataSize), pData); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1647 | |
| 1648 | vk::Cast(commandBuffer)->updateBuffer(dstBuffer, dstOffset, dataSize, pData); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1649 | } |
| 1650 | |
| 1651 | VKAPI_ATTR void VKAPI_CALL vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) |
| 1652 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1653 | TRACE("(VkCommandBuffer commandBuffer = %p, VkBuffer dstBuffer = %p, VkDeviceSize dstOffset = %d, VkDeviceSize size = %d, uint32_t data = %d)", |
| 1654 | commandBuffer, dstBuffer, int(dstOffset), int(size), data); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1655 | |
| 1656 | vk::Cast(commandBuffer)->fillBuffer(dstBuffer, dstOffset, size, data); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1657 | } |
| 1658 | |
| 1659 | VKAPI_ATTR void VKAPI_CALL vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) |
| 1660 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1661 | TRACE("(VkCommandBuffer commandBuffer = %p, VkImage image = %p, VkImageLayout imageLayout = %d, const VkClearColorValue* pColor = %p, uint32_t rangeCount = %d, const VkImageSubresourceRange* pRanges = %p)", |
| 1662 | commandBuffer, image, int(imageLayout), pColor, int(rangeCount), pRanges); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1663 | |
| 1664 | vk::Cast(commandBuffer)->clearColorImage(image, imageLayout, pColor, rangeCount, pRanges); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1665 | } |
| 1666 | |
| 1667 | VKAPI_ATTR void VKAPI_CALL vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) |
| 1668 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1669 | TRACE("(VkCommandBuffer commandBuffer = %p, VkImage image = %p, VkImageLayout imageLayout = %d, const VkClearDepthStencilValue* pDepthStencil = %p, uint32_t rangeCount = %d, const VkImageSubresourceRange* pRanges = %p)", |
| 1670 | commandBuffer, image, int(imageLayout), pDepthStencil, int(rangeCount), pRanges); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1671 | |
| 1672 | vk::Cast(commandBuffer)->clearDepthStencilImage(image, imageLayout, pDepthStencil, rangeCount, pRanges); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1673 | } |
| 1674 | |
| 1675 | VKAPI_ATTR void VKAPI_CALL vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects) |
| 1676 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1677 | TRACE("(VkCommandBuffer commandBuffer = %p, uint32_t attachmentCount = %d, const VkClearAttachment* pAttachments = %p, uint32_t rectCount = %d, const VkClearRect* pRects = %p)", |
| 1678 | commandBuffer, int(attachmentCount), pAttachments, int(rectCount), pRects); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1679 | |
| 1680 | vk::Cast(commandBuffer)->clearAttachments(attachmentCount, pAttachments, rectCount, pRects); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1681 | } |
| 1682 | |
| 1683 | VKAPI_ATTR void VKAPI_CALL vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) |
| 1684 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1685 | TRACE("(VkCommandBuffer commandBuffer = %p, VkImage srcImage = %p, VkImageLayout srcImageLayout = %d, VkImage dstImage = %p, VkImageLayout dstImageLayout = %d, uint32_t regionCount = %d, const VkImageResolve* pRegions = %p)", |
| 1686 | commandBuffer, srcImage, int(srcImageLayout), dstImage, int(dstImageLayout), regionCount, pRegions); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1687 | |
| 1688 | vk::Cast(commandBuffer)->resolveImage(srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1689 | } |
| 1690 | |
| 1691 | VKAPI_ATTR void VKAPI_CALL vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) |
| 1692 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1693 | TRACE("(VkCommandBuffer commandBuffer = %p, VkEvent event = %p, VkPipelineStageFlags stageMask = %d)", |
| 1694 | commandBuffer, event, int(stageMask)); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1695 | |
| 1696 | vk::Cast(commandBuffer)->setEvent(event, stageMask); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1697 | } |
| 1698 | |
| 1699 | VKAPI_ATTR void VKAPI_CALL vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) |
| 1700 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1701 | TRACE("(VkCommandBuffer commandBuffer = %p, VkEvent event = %p, VkPipelineStageFlags stageMask = %d)", |
| 1702 | commandBuffer, event, int(stageMask)); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1703 | |
| 1704 | vk::Cast(commandBuffer)->resetEvent(event, stageMask); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1705 | } |
| 1706 | |
| 1707 | VKAPI_ATTR void VKAPI_CALL vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 1708 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1709 | TRACE("(VkCommandBuffer commandBuffer = %p, uint32_t eventCount = %d, const VkEvent* pEvents = %p, VkPipelineStageFlags srcStageMask = 0x%x, VkPipelineStageFlags dstStageMask = 0x%x, uint32_t memoryBarrierCount = %d, const VkMemoryBarrier* pMemoryBarriers = %p, uint32_t bufferMemoryBarrierCount = %d, const VkBufferMemoryBarrier* pBufferMemoryBarriers = %p, uint32_t imageMemoryBarrierCount = %d, const VkImageMemoryBarrier* pImageMemoryBarriers = %p)", |
| 1710 | commandBuffer, int(eventCount), pEvents, int(srcStageMask), int(dstStageMask), int(memoryBarrierCount), pMemoryBarriers, int(bufferMemoryBarrierCount), pBufferMemoryBarriers, int(imageMemoryBarrierCount), pImageMemoryBarriers); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1711 | |
| 1712 | vk::Cast(commandBuffer)->waitEvents(eventCount, pEvents, srcStageMask, dstStageMask, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1713 | } |
| 1714 | |
| 1715 | VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 1716 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1717 | TRACE("(VkCommandBuffer commandBuffer = %p, VkPipelineStageFlags srcStageMask = 0x%x, VkPipelineStageFlags dstStageMask = 0x%x, VkDependencyFlags dependencyFlags = %d, uint32_t memoryBarrierCount = %d, onst VkMemoryBarrier* pMemoryBarriers = %p," |
| 1718 | " uint32_t bufferMemoryBarrierCount = %d, const VkBufferMemoryBarrier* pBufferMemoryBarriers = %p, uint32_t imageMemoryBarrierCount = %d, const VkImageMemoryBarrier* pImageMemoryBarriers = %p)", |
| 1719 | commandBuffer, int(srcStageMask), int(dstStageMask), dependencyFlags, int(memoryBarrierCount), pMemoryBarriers, int(bufferMemoryBarrierCount), pBufferMemoryBarriers, int(imageMemoryBarrierCount), pImageMemoryBarriers); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1720 | |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1721 | vk::Cast(commandBuffer)->pipelineBarrier(srcStageMask, dstStageMask, dependencyFlags, |
| 1722 | memoryBarrierCount, pMemoryBarriers, |
| 1723 | bufferMemoryBarrierCount, pBufferMemoryBarriers, |
| 1724 | imageMemoryBarrierCount, pImageMemoryBarriers); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1725 | } |
| 1726 | |
| 1727 | VKAPI_ATTR void VKAPI_CALL vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags) |
| 1728 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1729 | TRACE("(VkCommandBuffer commandBuffer = %p, VkQueryPool queryPool = %p, uint32_t query = %d, VkQueryControlFlags flags = %d)", |
| 1730 | commandBuffer, queryPool, query, int(flags)); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1731 | |
| 1732 | vk::Cast(commandBuffer)->beginQuery(queryPool, query, flags); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1733 | } |
| 1734 | |
| 1735 | VKAPI_ATTR void VKAPI_CALL vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query) |
| 1736 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1737 | TRACE("(VkCommandBuffer commandBuffer = %p, VkQueryPool queryPool = %p, uint32_t query = %d)", |
| 1738 | commandBuffer, queryPool, int(query)); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1739 | |
| 1740 | vk::Cast(commandBuffer)->endQuery(queryPool, query); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1741 | } |
| 1742 | |
| 1743 | VKAPI_ATTR void VKAPI_CALL vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) |
| 1744 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1745 | TRACE("(VkCommandBuffer commandBuffer = %p, VkQueryPool queryPool = %p, uint32_t firstQuery = %d, uint32_t queryCount = %d)", |
| 1746 | commandBuffer, queryPool, int(firstQuery), int(queryCount)); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1747 | |
| 1748 | vk::Cast(commandBuffer)->resetQueryPool(queryPool, firstQuery, queryCount); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1749 | } |
| 1750 | |
| 1751 | VKAPI_ATTR void VKAPI_CALL vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query) |
| 1752 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1753 | TRACE("(VkCommandBuffer commandBuffer = %p, VkPipelineStageFlagBits pipelineStage = %d, VkQueryPool queryPool = %p, uint32_t query = %d)", |
| 1754 | commandBuffer, int(pipelineStage), queryPool, int(query)); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1755 | |
| 1756 | vk::Cast(commandBuffer)->writeTimestamp(pipelineStage, queryPool, query); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1757 | } |
| 1758 | |
| 1759 | VKAPI_ATTR void VKAPI_CALL vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags) |
| 1760 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1761 | TRACE("(VkCommandBuffer commandBuffer = %p, VkQueryPool queryPool = %p, uint32_t firstQuery = %d, uint32_t queryCount = %d, VkBuffer dstBuffer = %p, VkDeviceSize dstOffset = %d, VkDeviceSize stride = %d, VkQueryResultFlags flags = %d)", |
| 1762 | commandBuffer, queryPool, int(firstQuery), int(queryCount), dstBuffer, int(dstOffset), int(stride), int(flags)); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1763 | |
| 1764 | vk::Cast(commandBuffer)->copyQueryPoolResults(queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1765 | } |
| 1766 | |
| 1767 | VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues) |
| 1768 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1769 | TRACE("(VkCommandBuffer commandBuffer = %p, VkPipelineLayout layout = %p, VkShaderStageFlags stageFlags = %d, uint32_t offset = %d, uint32_t size = %d, const void* pValues = %p)", |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1770 | commandBuffer, layout, stageFlags, offset, size, pValues); |
| 1771 | |
| 1772 | vk::Cast(commandBuffer)->pushConstants(layout, stageFlags, offset, size, pValues); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1773 | } |
| 1774 | |
| 1775 | VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents) |
| 1776 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1777 | TRACE("(VkCommandBuffer commandBuffer = %p, const VkRenderPassBeginInfo* pRenderPassBegin = %p, VkSubpassContents contents = %d)", |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 1778 | commandBuffer, pRenderPassBegin, contents); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1779 | |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1780 | if(pRenderPassBegin->pNext) |
| 1781 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1782 | UNIMPLEMENTED("pRenderPassBegin->pNext"); |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1783 | } |
| 1784 | |
| 1785 | vk::Cast(commandBuffer)->beginRenderPass(pRenderPassBegin->renderPass, pRenderPassBegin->framebuffer, |
| 1786 | pRenderPassBegin->renderArea, pRenderPassBegin->clearValueCount, |
| 1787 | pRenderPassBegin->pClearValues, contents); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1788 | } |
| 1789 | |
| 1790 | VKAPI_ATTR void VKAPI_CALL vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) |
| 1791 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1792 | TRACE("(VkCommandBuffer commandBuffer = %p, VkSubpassContents contents = %d)", |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1793 | commandBuffer, contents); |
| 1794 | |
| 1795 | vk::Cast(commandBuffer)->nextSubpass(contents); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1796 | } |
| 1797 | |
| 1798 | VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass(VkCommandBuffer commandBuffer) |
| 1799 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1800 | TRACE("(VkCommandBuffer commandBuffer = %p)", commandBuffer); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1801 | |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1802 | vk::Cast(commandBuffer)->endRenderPass(); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1803 | } |
| 1804 | |
| 1805 | VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers) |
| 1806 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1807 | TRACE("(VkCommandBuffer commandBuffer = %p, uint32_t commandBufferCount = %d, const VkCommandBuffer* pCommandBuffers = %p)", |
Alexis Hetu | a9999ce | 2018-10-17 08:00:43 -0400 | [diff] [blame] | 1808 | commandBuffer, commandBufferCount, pCommandBuffers); |
| 1809 | |
| 1810 | vk::Cast(commandBuffer)->executeCommands(commandBufferCount, pCommandBuffers); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1811 | } |
| 1812 | |
| 1813 | VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceVersion(uint32_t* pApiVersion) |
| 1814 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1815 | TRACE("(uint32_t* pApiVersion = %p)", pApiVersion); |
Nicolas Capens | ee841c5 | 2018-11-13 14:18:26 -0500 | [diff] [blame] | 1816 | *pApiVersion = vk::API_VERSION; |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1817 | return VK_SUCCESS; |
| 1818 | } |
| 1819 | |
| 1820 | VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos) |
| 1821 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1822 | TRACE("(VkDevice device = %p, uint32_t bindInfoCount = %d, const VkBindBufferMemoryInfo* pBindInfos = %p)", |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 1823 | device, bindInfoCount, pBindInfos); |
| 1824 | |
| 1825 | for(uint32_t i = 0; i < bindInfoCount; i++) |
| 1826 | { |
| 1827 | if(pBindInfos[i].pNext) |
| 1828 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1829 | UNIMPLEMENTED("pBindInfos[%d].pNext", i); |
Alexis Hetu | 38ff830 | 2018-10-18 15:08:13 -0400 | [diff] [blame] | 1830 | } |
| 1831 | |
| 1832 | vk::Cast(pBindInfos[i].buffer)->bind(pBindInfos[i].memory, pBindInfos[i].memoryOffset); |
| 1833 | } |
| 1834 | |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1835 | return VK_SUCCESS; |
| 1836 | } |
| 1837 | |
| 1838 | VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) |
| 1839 | { |
| 1840 | TRACE("()"); |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1841 | UNIMPLEMENTED("vkBindImageMemory2"); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1842 | return VK_SUCCESS; |
| 1843 | } |
| 1844 | |
| 1845 | VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeatures(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) |
| 1846 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1847 | TRACE("(VkDevice device = %p, uint32_t heapIndex = %d, uint32_t localDeviceIndex = %d, uint32_t remoteDeviceIndex = %d, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures = %p)", |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1848 | device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures); |
| 1849 | |
Nicolas Capens | 5028a58 | 2018-11-13 15:03:35 -0500 | [diff] [blame] | 1850 | ASSERT(localDeviceIndex != remoteDeviceIndex); // "localDeviceIndex must not equal remoteDeviceIndex" |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1851 | UNREACHABLE("remoteDeviceIndex: %d", int(remoteDeviceIndex)); // Only one physical device is supported, and since the device indexes can't be equal, this should never be called. |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1852 | } |
| 1853 | |
| 1854 | VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask) |
| 1855 | { |
| 1856 | TRACE("()"); |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1857 | UNIMPLEMENTED("vkCmdSetDeviceMask"); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1858 | } |
| 1859 | |
| 1860 | VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) |
| 1861 | { |
| 1862 | TRACE("()"); |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1863 | UNIMPLEMENTED("vkCmdDispatchBase"); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1864 | } |
| 1865 | |
| 1866 | VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) |
| 1867 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1868 | TRACE("VkInstance instance = %p, uint32_t* pPhysicalDeviceGroupCount = %p, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties = %p", |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1869 | instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties); |
| 1870 | |
| 1871 | if(!pPhysicalDeviceGroupProperties) |
| 1872 | { |
| 1873 | *pPhysicalDeviceGroupCount = vk::Cast(instance)->getPhysicalDeviceGroupCount(); |
| 1874 | } |
| 1875 | else |
| 1876 | { |
| 1877 | vk::Cast(instance)->getPhysicalDeviceGroups(*pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties); |
| 1878 | } |
| 1879 | |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1880 | return VK_SUCCESS; |
| 1881 | } |
| 1882 | |
| 1883 | VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) |
| 1884 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1885 | TRACE("(VkDevice device = %p, const VkImageMemoryRequirementsInfo2* pInfo = %p, VkMemoryRequirements2* pMemoryRequirements = %p)", |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1886 | device, pInfo, pMemoryRequirements); |
| 1887 | |
Alexis Hetu | 42761d2 | 2019-04-08 11:25:59 -0400 | [diff] [blame] | 1888 | if(pInfo->pNext) |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1889 | { |
Alexis Hetu | 42761d2 | 2019-04-08 11:25:59 -0400 | [diff] [blame] | 1890 | UNIMPLEMENTED("pInfo->pNext"); |
| 1891 | } |
| 1892 | |
| 1893 | VkBaseOutStructure* extensionRequirements = reinterpret_cast<VkBaseOutStructure*>(pMemoryRequirements->pNext); |
| 1894 | while(extensionRequirements) |
| 1895 | { |
| 1896 | switch(extensionRequirements->sType) |
| 1897 | { |
| 1898 | case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: |
| 1899 | { |
| 1900 | auto& requirements = *reinterpret_cast<VkMemoryDedicatedRequirements*>(extensionRequirements); |
| 1901 | requirements.prefersDedicatedAllocation = VK_FALSE; |
| 1902 | requirements.requiresDedicatedAllocation = VK_FALSE; |
| 1903 | } |
| 1904 | break; |
| 1905 | default: |
| 1906 | UNIMPLEMENTED("extensionRequirements->sType"); |
| 1907 | break; |
| 1908 | } |
| 1909 | |
| 1910 | extensionRequirements = extensionRequirements->pNext; |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1911 | } |
| 1912 | |
| 1913 | vkGetImageMemoryRequirements(device, pInfo->image, &(pMemoryRequirements->memoryRequirements)); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1914 | } |
| 1915 | |
| 1916 | VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) |
| 1917 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1918 | TRACE("(VkDevice device = %p, const VkBufferMemoryRequirementsInfo2* pInfo = %p, VkMemoryRequirements2* pMemoryRequirements = %p)", |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1919 | device, pInfo, pMemoryRequirements); |
| 1920 | |
Alexis Hetu | 1e6a989 | 2019-03-15 12:12:00 -0400 | [diff] [blame] | 1921 | if(pInfo->pNext) |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1922 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1923 | UNIMPLEMENTED("pInfo->pNext"); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1924 | } |
| 1925 | |
Alexis Hetu | 1e6a989 | 2019-03-15 12:12:00 -0400 | [diff] [blame] | 1926 | VkBaseOutStructure* extensionRequirements = reinterpret_cast<VkBaseOutStructure*>(pMemoryRequirements->pNext); |
| 1927 | while(extensionRequirements) |
| 1928 | { |
| 1929 | switch(extensionRequirements->sType) |
| 1930 | { |
| 1931 | case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: |
| 1932 | { |
| 1933 | auto& requirements = *reinterpret_cast<VkMemoryDedicatedRequirements*>(extensionRequirements); |
| 1934 | requirements.prefersDedicatedAllocation = VK_FALSE; |
| 1935 | requirements.requiresDedicatedAllocation = VK_FALSE; |
| 1936 | } |
| 1937 | break; |
| 1938 | default: |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1939 | UNIMPLEMENTED("extensionRequirements->sType"); |
Alexis Hetu | 1e6a989 | 2019-03-15 12:12:00 -0400 | [diff] [blame] | 1940 | break; |
| 1941 | } |
| 1942 | |
| 1943 | extensionRequirements = extensionRequirements->pNext; |
| 1944 | } |
| 1945 | |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1946 | vkGetBufferMemoryRequirements(device, pInfo->buffer, &(pMemoryRequirements->memoryRequirements)); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1947 | } |
| 1948 | |
| 1949 | VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) |
| 1950 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1951 | TRACE("(VkDevice device = %p, const VkImageSparseMemoryRequirementsInfo2* pInfo = %p, uint32_t* pSparseMemoryRequirementCount = %p, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements = %p)", |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1952 | device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements); |
| 1953 | |
| 1954 | if(pInfo->pNext || pSparseMemoryRequirements->pNext) |
| 1955 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 1956 | UNIMPLEMENTED("pInfo->pNext || pSparseMemoryRequirements->pNext"); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1957 | } |
| 1958 | |
| 1959 | vkGetImageSparseMemoryRequirements(device, pInfo->image, pSparseMemoryRequirementCount, &(pSparseMemoryRequirements->memoryRequirements)); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1960 | } |
| 1961 | |
| 1962 | VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures) |
| 1963 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 1964 | TRACE("(VkPhysicalDevice physicalDevice = %p, VkPhysicalDeviceFeatures2* pFeatures = %p)", physicalDevice, pFeatures); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 1965 | |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 1966 | VkBaseOutStructure* extensionFeatures = reinterpret_cast<VkBaseOutStructure*>(pFeatures->pNext); |
| 1967 | while(extensionFeatures) |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 1968 | { |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 1969 | switch(extensionFeatures->sType) |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1970 | { |
| 1971 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: |
| 1972 | { |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 1973 | auto& features = *reinterpret_cast<VkPhysicalDeviceSamplerYcbcrConversionFeatures*>(extensionFeatures); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1974 | vk::Cast(physicalDevice)->getFeatures(&features); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1975 | } |
| 1976 | break; |
| 1977 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: |
| 1978 | { |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 1979 | auto& features = *reinterpret_cast<VkPhysicalDevice16BitStorageFeatures*>(extensionFeatures); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1980 | vk::Cast(physicalDevice)->getFeatures(&features); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1981 | } |
| 1982 | break; |
| 1983 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES: |
| 1984 | { |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 1985 | auto& features = *reinterpret_cast<VkPhysicalDeviceVariablePointerFeatures*>(extensionFeatures); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1986 | vk::Cast(physicalDevice)->getFeatures(&features); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1987 | } |
| 1988 | break; |
| 1989 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR: |
| 1990 | { |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 1991 | auto& features = *reinterpret_cast<VkPhysicalDevice8BitStorageFeaturesKHR*>(extensionFeatures); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1992 | vk::Cast(physicalDevice)->getFeatures(&features); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1993 | } |
| 1994 | break; |
| 1995 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: |
| 1996 | { |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 1997 | auto& features = *reinterpret_cast<VkPhysicalDeviceMultiviewFeatures*>(extensionFeatures); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1998 | vk::Cast(physicalDevice)->getFeatures(&features); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 1999 | } |
| 2000 | break; |
| 2001 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: |
| 2002 | { |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 2003 | auto& features = *reinterpret_cast<VkPhysicalDeviceProtectedMemoryFeatures*>(extensionFeatures); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2004 | vk::Cast(physicalDevice)->getFeatures(&features); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2005 | } |
| 2006 | break; |
Chris Forbes | 6408c55 | 2019-04-15 12:59:34 -0700 | [diff] [blame] | 2007 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES: |
| 2008 | { |
| 2009 | auto& features = *reinterpret_cast<VkPhysicalDeviceShaderDrawParameterFeatures*>(extensionFeatures); |
| 2010 | vk::Cast(physicalDevice)->getFeatures(&features); |
| 2011 | } |
| 2012 | break; |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2013 | default: |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 2014 | // "the [driver] must skip over, without processing (other than reading the sType and pNext members) any structures in the chain with sType values not defined by [supported extenions]" |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 2015 | UNIMPLEMENTED("extensionFeatures->sType"); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here. |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 2016 | break; |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2017 | } |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 2018 | |
| 2019 | extensionFeatures = extensionFeatures->pNext; |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2020 | } |
| 2021 | |
| 2022 | vkGetPhysicalDeviceFeatures(physicalDevice, &(pFeatures->features)); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2023 | } |
| 2024 | |
| 2025 | VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties) |
| 2026 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2027 | TRACE("(VkPhysicalDevice physicalDevice = %p, VkPhysicalDeviceProperties2* pProperties = %p)", physicalDevice, pProperties); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2028 | |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 2029 | VkBaseOutStructure* extensionProperties = reinterpret_cast<VkBaseOutStructure*>(pProperties->pNext); |
| 2030 | while(extensionProperties) |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2031 | { |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 2032 | switch(extensionProperties->sType) |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2033 | { |
| 2034 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: |
| 2035 | { |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 2036 | auto& properties = *reinterpret_cast<VkPhysicalDeviceIDProperties*>(extensionProperties); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2037 | vk::Cast(physicalDevice)->getProperties(&properties); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2038 | } |
| 2039 | break; |
| 2040 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: |
| 2041 | { |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 2042 | auto& properties = *reinterpret_cast<VkPhysicalDeviceMaintenance3Properties*>(extensionProperties); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2043 | vk::Cast(physicalDevice)->getProperties(&properties); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2044 | } |
| 2045 | break; |
| 2046 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: |
| 2047 | { |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 2048 | auto& properties = *reinterpret_cast<VkPhysicalDeviceMultiviewProperties*>(extensionProperties); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2049 | vk::Cast(physicalDevice)->getProperties(&properties); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2050 | } |
| 2051 | break; |
| 2052 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: |
| 2053 | { |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 2054 | auto& properties = *reinterpret_cast<VkPhysicalDevicePointClippingProperties*>(extensionProperties); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2055 | vk::Cast(physicalDevice)->getProperties(&properties); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2056 | } |
| 2057 | break; |
| 2058 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: |
| 2059 | { |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 2060 | auto& properties = *reinterpret_cast<VkPhysicalDeviceProtectedMemoryProperties*>(extensionProperties); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2061 | vk::Cast(physicalDevice)->getProperties(&properties); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2062 | } |
| 2063 | break; |
| 2064 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: |
| 2065 | { |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 2066 | auto& properties = *reinterpret_cast<VkPhysicalDeviceSubgroupProperties*>(extensionProperties); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2067 | vk::Cast(physicalDevice)->getProperties(&properties); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2068 | } |
| 2069 | break; |
Alexis Hetu | d6fae38 | 2019-04-05 13:19:46 -0400 | [diff] [blame] | 2070 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: |
| 2071 | // Explicitly ignored, since VK_EXT_sample_locations is not supported |
| 2072 | ASSERT(!HasExtensionProperty(VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME, deviceExtensionProperties, |
| 2073 | sizeof(deviceExtensionProperties) / sizeof(deviceExtensionProperties[0]))); |
| 2074 | break; |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2075 | default: |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 2076 | // "the [driver] must skip over, without processing (other than reading the sType and pNext members) any structures in the chain with sType values not defined by [supported extenions]" |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 2077 | UNIMPLEMENTED("extensionProperties->sType"); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here. |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 2078 | break; |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2079 | } |
Nicolas Capens | ae8d464 | 2018-11-13 15:17:16 -0500 | [diff] [blame] | 2080 | |
| 2081 | extensionProperties = extensionProperties->pNext; |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2082 | } |
| 2083 | |
| 2084 | vkGetPhysicalDeviceProperties(physicalDevice, &(pProperties->properties)); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2085 | } |
| 2086 | |
| 2087 | VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties) |
| 2088 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2089 | TRACE("(VkPhysicalDevice physicalDevice = %p, VkFormat format = %d, VkFormatProperties2* pFormatProperties = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2090 | physicalDevice, format, pFormatProperties); |
| 2091 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2092 | if(pFormatProperties->pNext) |
| 2093 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 2094 | UNIMPLEMENTED("pFormatProperties->pNext"); |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2095 | } |
| 2096 | |
| 2097 | vkGetPhysicalDeviceFormatProperties(physicalDevice, format, &(pFormatProperties->formatProperties)); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2098 | } |
| 2099 | |
| 2100 | VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties) |
| 2101 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2102 | TRACE("(VkPhysicalDevice physicalDevice = %p, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo = %p, VkImageFormatProperties2* pImageFormatProperties = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2103 | physicalDevice, pImageFormatInfo, pImageFormatProperties); |
| 2104 | |
Alexis Hetu | 0083573 | 2019-04-10 16:36:31 -0400 | [diff] [blame] | 2105 | const VkBaseInStructure* extensionFormatInfo = reinterpret_cast<const VkBaseInStructure*>(pImageFormatInfo->pNext); |
| 2106 | |
| 2107 | const VkExternalMemoryHandleTypeFlagBits* handleType = nullptr; |
| 2108 | while(extensionFormatInfo) |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2109 | { |
Alexis Hetu | 0083573 | 2019-04-10 16:36:31 -0400 | [diff] [blame] | 2110 | switch(extensionFormatInfo->sType) |
| 2111 | { |
| 2112 | case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR: |
| 2113 | { |
| 2114 | // Explicitly ignored, since VK_KHR_image_format_list is not supported |
| 2115 | ASSERT(!HasExtensionProperty(VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME, deviceExtensionProperties, |
| 2116 | sizeof(deviceExtensionProperties) / sizeof(deviceExtensionProperties[0]))); |
| 2117 | } |
| 2118 | break; |
| 2119 | case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO_EXT: |
| 2120 | { |
| 2121 | // Explicitly ignored, since VK_EXT_separate_stencil_usage is not supported |
| 2122 | ASSERT(!HasExtensionProperty(VK_EXT_SEPARATE_STENCIL_USAGE_EXTENSION_NAME, deviceExtensionProperties, |
| 2123 | sizeof(deviceExtensionProperties) / sizeof(deviceExtensionProperties[0]))); |
| 2124 | } |
| 2125 | break; |
| 2126 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: |
| 2127 | { |
| 2128 | const VkPhysicalDeviceExternalImageFormatInfo* imageFormatInfo = reinterpret_cast<const VkPhysicalDeviceExternalImageFormatInfo*>(extensionFormatInfo); |
| 2129 | handleType = &(imageFormatInfo->handleType); |
| 2130 | } |
| 2131 | break; |
| 2132 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: |
| 2133 | { |
| 2134 | // Explicitly ignored, since VK_EXT_image_drm_format_modifier is not supported |
| 2135 | ASSERT(!HasExtensionProperty(VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME, deviceExtensionProperties, |
| 2136 | sizeof(deviceExtensionProperties) / sizeof(deviceExtensionProperties[0]))); |
| 2137 | } |
| 2138 | break; |
| 2139 | default: |
| 2140 | UNIMPLEMENTED("extensionFormatInfo->sType"); |
| 2141 | break; |
| 2142 | } |
| 2143 | |
| 2144 | extensionFormatInfo = extensionFormatInfo->pNext; |
| 2145 | } |
| 2146 | |
| 2147 | VkBaseOutStructure* extensionProperties = reinterpret_cast<VkBaseOutStructure*>(pImageFormatProperties->pNext); |
| 2148 | |
| 2149 | while(extensionProperties) |
| 2150 | { |
| 2151 | switch(extensionProperties->sType) |
| 2152 | { |
| 2153 | case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: |
| 2154 | { |
| 2155 | auto& properties = *reinterpret_cast<VkExternalImageFormatProperties*>(extensionProperties); |
| 2156 | vk::Cast(physicalDevice)->getProperties(handleType, &properties); |
| 2157 | } |
| 2158 | break; |
| 2159 | case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: |
| 2160 | { |
| 2161 | auto& properties = *reinterpret_cast<VkSamplerYcbcrConversionImageFormatProperties*>(extensionProperties); |
| 2162 | vk::Cast(physicalDevice)->getProperties(&properties); |
| 2163 | } |
| 2164 | break; |
| 2165 | case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: |
| 2166 | { |
| 2167 | // Explicitly ignored, since VK_AMD_texture_gather_bias_lod is not supported |
| 2168 | ASSERT(!HasExtensionProperty(VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME, deviceExtensionProperties, |
| 2169 | sizeof(deviceExtensionProperties) / sizeof(deviceExtensionProperties[0]))); |
| 2170 | } |
| 2171 | break; |
| 2172 | default: |
| 2173 | UNIMPLEMENTED("extensionProperties->sType"); |
| 2174 | break; |
| 2175 | } |
| 2176 | |
| 2177 | extensionProperties = extensionProperties->pNext; |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2178 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2179 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2180 | return vkGetPhysicalDeviceImageFormatProperties(physicalDevice, |
| 2181 | pImageFormatInfo->format, |
| 2182 | pImageFormatInfo->type, |
| 2183 | pImageFormatInfo->tiling, |
| 2184 | pImageFormatInfo->usage, |
| 2185 | pImageFormatInfo->flags, |
| 2186 | &(pImageFormatProperties->imageFormatProperties)); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2187 | } |
| 2188 | |
| 2189 | VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties) |
| 2190 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2191 | TRACE("(VkPhysicalDevice physicalDevice = %p, uint32_t* pQueueFamilyPropertyCount = %p, VkQueueFamilyProperties2* pQueueFamilyProperties = %p)", |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2192 | physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); |
| 2193 | |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2194 | if(pQueueFamilyProperties && pQueueFamilyProperties->pNext) |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2195 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 2196 | UNIMPLEMENTED("pQueueFamilyProperties->pNext"); |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2197 | } |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2198 | |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2199 | vkGetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, |
| 2200 | pQueueFamilyProperties ? &(pQueueFamilyProperties->queueFamilyProperties) : nullptr); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2201 | } |
| 2202 | |
| 2203 | VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties) |
| 2204 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2205 | TRACE("(VkPhysicalDevice physicalDevice = %p, VkPhysicalDeviceMemoryProperties2* pMemoryProperties = %p)", physicalDevice, pMemoryProperties); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2206 | |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2207 | if(pMemoryProperties->pNext) |
| 2208 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 2209 | UNIMPLEMENTED("pMemoryProperties->pNext"); |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2210 | } |
| 2211 | |
| 2212 | vkGetPhysicalDeviceMemoryProperties(physicalDevice, &(pMemoryProperties->memoryProperties)); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2213 | } |
| 2214 | |
| 2215 | VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties) |
| 2216 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2217 | TRACE("(VkPhysicalDevice physicalDevice = %p, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo = %p, uint32_t* pPropertyCount = %p, VkSparseImageFormatProperties2* pProperties = %p)", |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2218 | physicalDevice, pFormatInfo, pPropertyCount, pProperties); |
| 2219 | |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2220 | if(pProperties && pProperties->pNext) |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2221 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 2222 | UNIMPLEMENTED("pProperties->pNext"); |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2223 | } |
Alexis Hetu | 767b41b | 2018-09-26 11:25:46 -0400 | [diff] [blame] | 2224 | |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2225 | vkGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, pFormatInfo->format, pFormatInfo->type, |
| 2226 | pFormatInfo->samples, pFormatInfo->usage, pFormatInfo->tiling, |
| 2227 | pPropertyCount, pProperties ? &(pProperties->properties) : nullptr); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2228 | } |
| 2229 | |
| 2230 | VKAPI_ATTR void VKAPI_CALL vkTrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) |
| 2231 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2232 | TRACE("(VkDevice device = %p, VkCommandPool commandPool = %p, VkCommandPoolTrimFlags flags = %d)", |
Nicolas Capens | de16f32 | 2019-02-12 00:32:31 -0500 | [diff] [blame] | 2233 | device, commandPool, flags); |
| 2234 | |
Alexis Hetu | cd610c9 | 2019-02-01 16:47:51 -0500 | [diff] [blame] | 2235 | vk::Cast(commandPool)->trim(flags); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2236 | } |
| 2237 | |
| 2238 | VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue) |
| 2239 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2240 | TRACE("(VkDevice device = %p, const VkDeviceQueueInfo2* pQueueInfo = %p, VkQueue* pQueue = %p)", |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2241 | device, pQueueInfo, pQueue); |
| 2242 | |
| 2243 | if(pQueueInfo->pNext) |
| 2244 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 2245 | UNIMPLEMENTED("pQueueInfo->pNext"); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2246 | } |
| 2247 | |
Nicolas Capens | 50b1059 | 2018-10-26 10:34:20 -0400 | [diff] [blame] | 2248 | // The only flag that can be set here is VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2249 | // According to the Vulkan spec, 4.3.1. Queue Family Properties: |
| 2250 | // "VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT specifies that the device queue is a |
| 2251 | // protected-capable queue. If the protected memory feature is not enabled, |
| 2252 | // the VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT bit of flags must not be set." |
| 2253 | if(pQueueInfo->flags) |
| 2254 | { |
| 2255 | *pQueue = VK_NULL_HANDLE; |
| 2256 | } |
| 2257 | else |
| 2258 | { |
| 2259 | vkGetDeviceQueue(device, pQueueInfo->queueFamilyIndex, pQueueInfo->queueIndex, pQueue); |
| 2260 | } |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2261 | } |
| 2262 | |
| 2263 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) |
| 2264 | { |
| 2265 | TRACE("()"); |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 2266 | UNIMPLEMENTED("vkCreateSamplerYcbcrConversion"); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2267 | return VK_SUCCESS; |
| 2268 | } |
| 2269 | |
| 2270 | VKAPI_ATTR void VKAPI_CALL vkDestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator) |
| 2271 | { |
| 2272 | TRACE("()"); |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 2273 | UNIMPLEMENTED("vkDestroySamplerYcbcrConversion"); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2274 | } |
| 2275 | |
| 2276 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) |
| 2277 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2278 | TRACE("(VkDevice device = %p, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate = %p)", |
Alexis Hetu | f705cec | 2019-01-29 14:09:36 -0500 | [diff] [blame] | 2279 | device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); |
| 2280 | |
| 2281 | if(pCreateInfo->pNext || pCreateInfo->flags || (pCreateInfo->templateType != VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET)) |
| 2282 | { |
Ben Clayton | 00424c1 | 2019-03-17 17:29:30 +0000 | [diff] [blame] | 2283 | UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags || (pCreateInfo->templateType != VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET)"); |
Alexis Hetu | f705cec | 2019-01-29 14:09:36 -0500 | [diff] [blame] | 2284 | } |
| 2285 | |
| 2286 | return vk::DescriptorUpdateTemplate::Create(pAllocator, pCreateInfo, pDescriptorUpdateTemplate); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2287 | } |
| 2288 | |
| 2289 | VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) |
| 2290 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2291 | TRACE("(VkDevice device = %p, VkDescriptorUpdateTemplate descriptorUpdateTemplate = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Alexis Hetu | f705cec | 2019-01-29 14:09:36 -0500 | [diff] [blame] | 2292 | device, descriptorUpdateTemplate, pAllocator); |
| 2293 | |
| 2294 | vk::destroy(descriptorUpdateTemplate, pAllocator); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2295 | } |
| 2296 | |
| 2297 | VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) |
| 2298 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2299 | TRACE("(VkDevice device = %p, VkDescriptorSet descriptorSet = %p, VkDescriptorUpdateTemplate descriptorUpdateTemplate = %p, const void* pData = %p)", |
Alexis Hetu | f705cec | 2019-01-29 14:09:36 -0500 | [diff] [blame] | 2300 | device, descriptorSet, descriptorUpdateTemplate, pData); |
| 2301 | |
| 2302 | vk::Cast(descriptorUpdateTemplate)->updateDescriptorSet(descriptorSet, pData); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2303 | } |
| 2304 | |
| 2305 | VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties) |
| 2306 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2307 | TRACE("(VkPhysicalDevice physicalDevice = %p, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo = %p, VkExternalBufferProperties* pExternalBufferProperties = %p)", |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2308 | physicalDevice, pExternalBufferInfo, pExternalBufferProperties); |
| 2309 | |
Alexis Hetu | 0083573 | 2019-04-10 16:36:31 -0400 | [diff] [blame] | 2310 | vk::Cast(physicalDevice)->getProperties(pExternalBufferInfo, pExternalBufferProperties); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2311 | } |
| 2312 | |
| 2313 | VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties) |
| 2314 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2315 | TRACE("(VkPhysicalDevice physicalDevice = %p, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo = %p, VkExternalFenceProperties* pExternalFenceProperties = %p)", |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2316 | physicalDevice, pExternalFenceInfo, pExternalFenceProperties); |
| 2317 | |
Alexis Hetu | 0083573 | 2019-04-10 16:36:31 -0400 | [diff] [blame] | 2318 | vk::Cast(physicalDevice)->getProperties(pExternalFenceInfo, pExternalFenceProperties); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2319 | } |
| 2320 | |
| 2321 | VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties) |
| 2322 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2323 | TRACE("(VkPhysicalDevice physicalDevice = %p, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo = %p, VkExternalSemaphoreProperties* pExternalSemaphoreProperties = %p)", |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2324 | physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties); |
| 2325 | |
Alexis Hetu | 0083573 | 2019-04-10 16:36:31 -0400 | [diff] [blame] | 2326 | vk::Cast(physicalDevice)->getProperties(pExternalSemaphoreInfo, pExternalSemaphoreProperties); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2327 | } |
| 2328 | |
| 2329 | VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) |
| 2330 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2331 | TRACE("(VkDevice device = %p, const VkDescriptorSetLayoutCreateInfo* pCreateInfo = %p, VkDescriptorSetLayoutSupport* pSupport = %p)", |
Alexis Hetu | 1424ef6 | 2019-04-05 18:03:53 -0400 | [diff] [blame] | 2332 | device, pCreateInfo, pSupport); |
Alexis Hetu | 9e4d040 | 2018-10-16 15:44:12 -0400 | [diff] [blame] | 2333 | |
| 2334 | vk::Cast(device)->getDescriptorSetLayoutSupport(pCreateInfo, pSupport); |
Alexis Hetu | d73b871 | 2018-09-21 15:14:43 -0400 | [diff] [blame] | 2335 | } |
| 2336 | |
Hernan Liatis | c6eb41b | 2019-02-22 11:12:59 -0800 | [diff] [blame] | 2337 | #ifdef VK_USE_PLATFORM_XLIB_KHR |
| 2338 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) |
| 2339 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2340 | TRACE("(VkInstance instance = %p, VkXlibSurfaceCreateInfoKHR* pCreateInfo = %p, VkAllocationCallbacks* pAllocator = %p, VkSurface* pSurface = %p)", |
Hernan Liatis | c6eb41b | 2019-02-22 11:12:59 -0800 | [diff] [blame] | 2341 | instance, pCreateInfo, pAllocator, pSurface); |
| 2342 | |
| 2343 | return vk::XlibSurfaceKHR::Create(pAllocator, pCreateInfo, pSurface); |
| 2344 | } |
| 2345 | #endif |
| 2346 | |
Chris Forbes | 1d667d6 | 2019-04-05 08:25:18 -0700 | [diff] [blame] | 2347 | #ifndef __ANDROID__ |
| 2348 | VKAPI_ATTR void VKAPI_CALL vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator) |
| 2349 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2350 | TRACE("(VkInstance instance = %p, VkSurfaceKHR surface = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Chris Forbes | 1d667d6 | 2019-04-05 08:25:18 -0700 | [diff] [blame] | 2351 | instance, surface, pAllocator); |
| 2352 | |
| 2353 | vk::destroy(surface, pAllocator); |
| 2354 | } |
| 2355 | |
Hernan Liatis | c6eb41b | 2019-02-22 11:12:59 -0800 | [diff] [blame] | 2356 | VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported) |
| 2357 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2358 | TRACE("(VkPhysicalDevice physicalDevice = %p, uint32_t queueFamilyIndex = %d, VkSurface surface = %p, VKBool32* pSupported = %p)", |
| 2359 | physicalDevice, int(queueFamilyIndex), surface, pSupported); |
Hernan Liatis | c6eb41b | 2019-02-22 11:12:59 -0800 | [diff] [blame] | 2360 | |
| 2361 | *pSupported = VK_TRUE; |
| 2362 | return VK_SUCCESS; |
| 2363 | } |
| 2364 | |
| 2365 | |
| 2366 | VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) |
| 2367 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2368 | TRACE("(VkPhysicalDevice physicalDevice = %p, VkSurfaceKHR surface = %p, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities = %p)", |
Hernan Liatis | c6eb41b | 2019-02-22 11:12:59 -0800 | [diff] [blame] | 2369 | physicalDevice, surface, pSurfaceCapabilities); |
| 2370 | |
| 2371 | vk::Cast(surface)->getSurfaceCapabilities(pSurfaceCapabilities); |
| 2372 | return VK_SUCCESS; |
| 2373 | } |
| 2374 | |
| 2375 | VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats) |
| 2376 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2377 | TRACE("(VkPhysicalDevice physicalDevice = %p, VkSurfaceKHR surface = %p. uint32_t* pSurfaceFormatCount = %p, VkSurfaceFormatKHR* pSurfaceFormats = %p)", |
Hernan Liatis | c6eb41b | 2019-02-22 11:12:59 -0800 | [diff] [blame] | 2378 | physicalDevice, surface, pSurfaceFormatCount, pSurfaceFormats); |
| 2379 | |
| 2380 | if(!pSurfaceFormats) |
| 2381 | { |
| 2382 | *pSurfaceFormatCount = vk::Cast(surface)->getSurfaceFormatsCount(); |
| 2383 | return VK_SUCCESS; |
| 2384 | } |
| 2385 | |
| 2386 | return vk::Cast(surface)->getSurfaceFormats(pSurfaceFormatCount, pSurfaceFormats); |
| 2387 | } |
| 2388 | |
| 2389 | VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes) |
| 2390 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2391 | TRACE("(VkPhysicalDevice physicalDevice = %p, VkSurfaceKHR surface = %p uint32_t* pPresentModeCount = %p, VkPresentModeKHR* pPresentModes = %p)", |
Hernan Liatis | c6eb41b | 2019-02-22 11:12:59 -0800 | [diff] [blame] | 2392 | physicalDevice, surface, pPresentModeCount, pPresentModes); |
| 2393 | |
| 2394 | if(!pPresentModes) |
| 2395 | { |
| 2396 | *pPresentModeCount = vk::Cast(surface)->getPresentModeCount(); |
| 2397 | return VK_SUCCESS; |
| 2398 | } |
| 2399 | |
| 2400 | return vk::Cast(surface)->getPresentModes(pPresentModeCount, pPresentModes); |
| 2401 | } |
| 2402 | |
Hernan Liatis | c7943e9 | 2019-02-25 19:29:54 -0800 | [diff] [blame] | 2403 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain) |
| 2404 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2405 | TRACE("(VkDevice device = %p, const VkSwapchainCreateInfoKHR* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkSwapchainKHR* pSwapchain = %p)", |
Hernan Liatis | c7943e9 | 2019-02-25 19:29:54 -0800 | [diff] [blame] | 2406 | device, pCreateInfo, pAllocator, pSwapchain); |
| 2407 | |
Hernan Liatis | 43be716 | 2019-03-08 17:57:41 -0800 | [diff] [blame] | 2408 | if(pCreateInfo->oldSwapchain) |
| 2409 | { |
| 2410 | vk::Cast(pCreateInfo->oldSwapchain)->retire(); |
| 2411 | } |
| 2412 | |
| 2413 | if(vk::Cast(pCreateInfo->surface)->getAssociatedSwapchain() != VK_NULL_HANDLE) |
| 2414 | { |
| 2415 | return VK_ERROR_NATIVE_WINDOW_IN_USE_KHR; |
| 2416 | } |
| 2417 | |
Hernan Liatis | c7943e9 | 2019-02-25 19:29:54 -0800 | [diff] [blame] | 2418 | VkResult status = vk::SwapchainKHR::Create(pAllocator, pCreateInfo, pSwapchain); |
| 2419 | |
| 2420 | if(status != VK_SUCCESS) |
| 2421 | { |
| 2422 | return status; |
| 2423 | } |
| 2424 | |
| 2425 | status = vk::Cast(*pSwapchain)->createImages(device); |
| 2426 | |
| 2427 | if(status != VK_SUCCESS) |
| 2428 | { |
| 2429 | vk::destroy(*pSwapchain, pAllocator); |
| 2430 | return status; |
| 2431 | } |
| 2432 | |
Hernan Liatis | 43be716 | 2019-03-08 17:57:41 -0800 | [diff] [blame] | 2433 | vk::Cast(pCreateInfo->surface)->associateSwapchain(*pSwapchain); |
| 2434 | |
Hernan Liatis | c7943e9 | 2019-02-25 19:29:54 -0800 | [diff] [blame] | 2435 | return VK_SUCCESS; |
| 2436 | } |
| 2437 | |
| 2438 | VKAPI_ATTR void VKAPI_CALL vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator) |
| 2439 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2440 | TRACE("(VkDevice device = %p, VkSwapchainKHR swapchain = %p, const VkAllocationCallbacks* pAllocator = %p)", |
Hernan Liatis | c7943e9 | 2019-02-25 19:29:54 -0800 | [diff] [blame] | 2441 | device, swapchain, pAllocator); |
| 2442 | |
| 2443 | vk::destroy(swapchain, pAllocator); |
| 2444 | } |
| 2445 | |
Hernan Liatis | d00375a | 2019-02-26 11:19:27 -0800 | [diff] [blame] | 2446 | VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages) |
| 2447 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2448 | TRACE("(VkDevice device = %p, VkSwapchainKHR swapchain = %p, uint32_t* pSwapchainImageCount = %p, VkImage* pSwapchainImages = %p)", |
Hernan Liatis | d00375a | 2019-02-26 11:19:27 -0800 | [diff] [blame] | 2449 | device, swapchain, pSwapchainImageCount, pSwapchainImages); |
| 2450 | |
| 2451 | if(!pSwapchainImages) |
| 2452 | { |
| 2453 | *pSwapchainImageCount = vk::Cast(swapchain)->getImageCount(); |
| 2454 | return VK_SUCCESS; |
| 2455 | } |
| 2456 | |
| 2457 | return vk::Cast(swapchain)->getImages(pSwapchainImageCount, pSwapchainImages); |
| 2458 | } |
| 2459 | |
Hernan Liatis | 6b12a50 | 2019-03-01 15:06:13 -0800 | [diff] [blame] | 2460 | VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex) |
| 2461 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2462 | TRACE("(VkDevice device = %p, VkSwapchainKHR swapchain = %p, uint64_t timeout = %d, VkSemaphore semaphore = %p, VkFence fence = %p, uint32_t* pImageIndex = %p)", |
| 2463 | device, swapchain, int(timeout), semaphore, fence, pImageIndex); |
Hernan Liatis | 6b12a50 | 2019-03-01 15:06:13 -0800 | [diff] [blame] | 2464 | |
| 2465 | return vk::Cast(swapchain)->getNextImage(timeout, semaphore, fence, pImageIndex); |
| 2466 | } |
| 2467 | |
| 2468 | VKAPI_ATTR VkResult VKAPI_CALL vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo) |
| 2469 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2470 | TRACE("(VkQueue queue = %p, const VkPresentInfoKHR* pPresentInfo = %p)", |
Hernan Liatis | 6b12a50 | 2019-03-01 15:06:13 -0800 | [diff] [blame] | 2471 | queue, pPresentInfo); |
| 2472 | |
| 2473 | vk::Cast(queue)->present(pPresentInfo); |
| 2474 | |
| 2475 | return VK_SUCCESS; |
| 2476 | } |
Chris Forbes | f993de3 | 2019-04-15 09:45:34 -0700 | [diff] [blame] | 2477 | |
| 2478 | VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupPresentCapabilitiesKHR(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR *pDeviceGroupPresentCapabilities) |
| 2479 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2480 | TRACE("(VkDevice device = %p, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities = %p)", |
Chris Forbes | f993de3 | 2019-04-15 09:45:34 -0700 | [diff] [blame] | 2481 | device, pDeviceGroupPresentCapabilities); |
| 2482 | |
| 2483 | for (int i = 0; i < VK_MAX_DEVICE_GROUP_SIZE; i++) |
| 2484 | { |
| 2485 | // The only real physical device in the presentation group is device 0, |
| 2486 | // and it can present to itself. |
| 2487 | pDeviceGroupPresentCapabilities->presentMask[i] = (i == 0) ? 1 : 0; |
| 2488 | } |
| 2489 | |
| 2490 | pDeviceGroupPresentCapabilities->modes = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR; |
| 2491 | |
| 2492 | return VK_SUCCESS; |
| 2493 | } |
| 2494 | |
| 2495 | VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR *pModes) |
| 2496 | { |
Ben Clayton | fb28067 | 2019-04-25 11:16:15 +0100 | [diff] [blame^] | 2497 | TRACE("(VkDevice device = %p, VkSurfaceKHR surface = %p, VkDeviceGroupPresentModeFlagsKHR *pModes = %p)", |
Chris Forbes | f993de3 | 2019-04-15 09:45:34 -0700 | [diff] [blame] | 2498 | device, surface, pModes); |
| 2499 | |
| 2500 | *pModes = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR; |
| 2501 | return VK_SUCCESS; |
| 2502 | } |
| 2503 | |
Chris Forbes | 1d667d6 | 2019-04-05 08:25:18 -0700 | [diff] [blame] | 2504 | #endif // ! __ANDROID__ |
Hernan Liatis | 6b12a50 | 2019-03-01 15:06:13 -0800 | [diff] [blame] | 2505 | |
Chris Forbes | 3d27f2e | 2018-09-26 09:24:39 -0700 | [diff] [blame] | 2506 | } |