Jesse Hall | 04f4f47 | 2015-08-16 19:51:04 -0700 | [diff] [blame^] | 1 | #include <hardware/hwvulkan.h> |
| 2 | |
| 3 | #include <string.h> |
| 4 | #include <algorithm> |
| 5 | |
| 6 | #include <utils/Errors.h> |
| 7 | |
| 8 | #include "null_driver.h" |
| 9 | |
| 10 | using namespace null_driver; |
| 11 | |
| 12 | struct VkPhysicalDevice_T { |
| 13 | hwvulkan_dispatch_t dispatch; |
| 14 | }; |
| 15 | |
| 16 | struct VkInstance_T { |
| 17 | hwvulkan_dispatch_t dispatch; |
| 18 | const VkAllocCallbacks* alloc; |
| 19 | VkPhysicalDevice_T physical_device; |
| 20 | }; |
| 21 | |
| 22 | struct VkQueue_T { |
| 23 | hwvulkan_dispatch_t dispatch; |
| 24 | }; |
| 25 | |
| 26 | struct VkCmdBuffer_T { |
| 27 | hwvulkan_dispatch_t dispatch; |
| 28 | }; |
| 29 | |
| 30 | struct VkDevice_T { |
| 31 | hwvulkan_dispatch_t dispatch; |
| 32 | VkInstance_T* instance; |
| 33 | VkQueue_T queue; |
| 34 | }; |
| 35 | |
| 36 | // ----------------------------------------------------------------------------- |
| 37 | // Declare HAL_MODULE_INFO_SYM early so it can be referenced by nulldrv_device |
| 38 | // later. |
| 39 | |
| 40 | namespace { |
| 41 | int OpenDevice(const hw_module_t* module, const char* id, hw_device_t** device); |
| 42 | hw_module_methods_t nulldrv_module_methods = {.open = OpenDevice}; |
| 43 | } // namespace |
| 44 | |
| 45 | #pragma clang diagnostic push |
| 46 | #pragma clang diagnostic ignored "-Wmissing-variable-declarations" |
| 47 | __attribute__((visibility("default"))) hwvulkan_module_t HAL_MODULE_INFO_SYM = { |
| 48 | .common = |
| 49 | { |
| 50 | .tag = HARDWARE_MODULE_TAG, |
| 51 | .module_api_version = HWVULKAN_MODULE_API_VERSION_0_1, |
| 52 | .hal_api_version = HARDWARE_HAL_API_VERSION, |
| 53 | .id = HWVULKAN_HARDWARE_MODULE_ID, |
| 54 | .name = "Null Vulkan Driver", |
| 55 | .author = "The Android Open Source Project", |
| 56 | .methods = &nulldrv_module_methods, |
| 57 | }, |
| 58 | }; |
| 59 | #pragma clang diagnostic pop |
| 60 | |
| 61 | // ----------------------------------------------------------------------------- |
| 62 | |
| 63 | namespace { |
| 64 | |
| 65 | VkResult CreateInstance(const VkInstanceCreateInfo* create_info, |
| 66 | VkInstance* out_instance) { |
| 67 | VkInstance_T* instance = |
| 68 | static_cast<VkInstance_T*>(create_info->pAllocCb->pfnAlloc( |
| 69 | create_info->pAllocCb->pUserData, sizeof(VkInstance_T), |
| 70 | alignof(VkInstance_T), VK_SYSTEM_ALLOC_TYPE_API_OBJECT)); |
| 71 | if (!instance) |
| 72 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 73 | |
| 74 | instance->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
| 75 | instance->alloc = create_info->pAllocCb; |
| 76 | instance->physical_device.dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
| 77 | |
| 78 | *out_instance = instance; |
| 79 | return VK_SUCCESS; |
| 80 | } |
| 81 | |
| 82 | int CloseDevice(struct hw_device_t* /*device*/) { |
| 83 | // nothing to do - opening a device doesn't allocate any resources |
| 84 | return 0; |
| 85 | } |
| 86 | |
| 87 | hwvulkan_device_t nulldrv_device = { |
| 88 | .common = |
| 89 | { |
| 90 | .tag = HARDWARE_DEVICE_TAG, |
| 91 | .version = HWVULKAN_DEVICE_API_VERSION_0_1, |
| 92 | .module = &HAL_MODULE_INFO_SYM.common, |
| 93 | .close = CloseDevice, |
| 94 | }, |
| 95 | .GetGlobalExtensionProperties = GetGlobalExtensionProperties, |
| 96 | .CreateInstance = CreateInstance, |
| 97 | .GetInstanceProcAddr = GetInstanceProcAddr}; |
| 98 | |
| 99 | int OpenDevice(const hw_module_t* /*module*/, |
| 100 | const char* id, |
| 101 | hw_device_t** device) { |
| 102 | if (strcmp(id, HWVULKAN_DEVICE_0) == 0) { |
| 103 | *device = &nulldrv_device.common; |
| 104 | return 0; |
| 105 | } |
| 106 | return -ENOENT; |
| 107 | } |
| 108 | |
| 109 | VkInstance_T* GetInstanceFromPhysicalDevice( |
| 110 | VkPhysicalDevice_T* physical_device) { |
| 111 | return reinterpret_cast<VkInstance_T*>( |
| 112 | reinterpret_cast<uintptr_t>(physical_device) - |
| 113 | offsetof(VkInstance_T, physical_device)); |
| 114 | } |
| 115 | |
| 116 | } // namespace |
| 117 | |
| 118 | namespace null_driver { |
| 119 | |
| 120 | PFN_vkVoidFunction GetInstanceProcAddr(VkInstance, const char* name) { |
| 121 | PFN_vkVoidFunction proc = LookupInstanceProcAddr(name); |
| 122 | if (!proc && strcmp(name, "vkGetDeviceProcAddr") == 0) |
| 123 | proc = reinterpret_cast<PFN_vkVoidFunction>(GetDeviceProcAddr); |
| 124 | return proc; |
| 125 | } |
| 126 | |
| 127 | PFN_vkVoidFunction GetDeviceProcAddr(VkDevice, const char* name) { |
| 128 | return LookupDeviceProcAddr(name); |
| 129 | } |
| 130 | |
| 131 | VkResult DestroyInstance(VkInstance instance) { |
| 132 | instance->alloc->pfnFree(instance->alloc->pUserData, instance); |
| 133 | return VK_SUCCESS; |
| 134 | } |
| 135 | |
| 136 | VkResult EnumeratePhysicalDevices(VkInstance instance, |
| 137 | uint32_t* physical_device_count, |
| 138 | VkPhysicalDevice* physical_devices) { |
| 139 | if (physical_devices && *physical_device_count >= 1) |
| 140 | physical_devices[0] = &instance->physical_device; |
| 141 | *physical_device_count = 1; |
| 142 | return VK_SUCCESS; |
| 143 | } |
| 144 | |
| 145 | VkResult GetPhysicalDeviceProperties(VkPhysicalDevice, |
| 146 | VkPhysicalDeviceProperties* properties) { |
| 147 | properties->apiVersion = VK_API_VERSION; |
| 148 | properties->driverVersion = VK_MAKE_VERSION(0, 0, 1); |
| 149 | properties->vendorId = 0xC0DE; |
| 150 | properties->deviceId = 0xCAFE; |
| 151 | properties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER; |
| 152 | strcpy(properties->deviceName, "Android Vulkan Null Driver"); |
| 153 | memset(properties->pipelineCacheUUID, 0, |
| 154 | sizeof(properties->pipelineCacheUUID)); |
| 155 | return VK_SUCCESS; |
| 156 | } |
| 157 | |
| 158 | VkResult GetGlobalExtensionProperties(const char*, |
| 159 | uint32_t* count, |
| 160 | VkExtensionProperties*) { |
| 161 | *count = 0; |
| 162 | return VK_SUCCESS; |
| 163 | } |
| 164 | |
| 165 | VkResult CreateDevice(VkPhysicalDevice physical_device, |
| 166 | const VkDeviceCreateInfo*, |
| 167 | VkDevice* out_device) { |
| 168 | VkInstance_T* instance = GetInstanceFromPhysicalDevice(physical_device); |
| 169 | VkDevice_T* device = static_cast<VkDevice_T*>(instance->alloc->pfnAlloc( |
| 170 | instance->alloc->pUserData, sizeof(VkDevice_T), alignof(VkDevice_T), |
| 171 | VK_SYSTEM_ALLOC_TYPE_API_OBJECT)); |
| 172 | if (!device) |
| 173 | return VK_ERROR_OUT_OF_HOST_MEMORY; |
| 174 | |
| 175 | device->dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
| 176 | device->instance = instance; |
| 177 | device->queue.dispatch.magic = HWVULKAN_DISPATCH_MAGIC; |
| 178 | |
| 179 | *out_device = device; |
| 180 | return VK_SUCCESS; |
| 181 | } |
| 182 | |
| 183 | VkResult DestroyDevice(VkDevice device) { |
| 184 | if (!device) |
| 185 | return VK_SUCCESS; |
| 186 | const VkAllocCallbacks* alloc = device->instance->alloc; |
| 187 | alloc->pfnFree(alloc->pUserData, device); |
| 188 | return VK_SUCCESS; |
| 189 | } |
| 190 | |
| 191 | VkResult GetDeviceQueue(VkDevice device, uint32_t, uint32_t, VkQueue* queue) { |
| 192 | *queue = &device->queue; |
| 193 | return VK_SUCCESS; |
| 194 | } |
| 195 | |
| 196 | // ----------------------------------------------------------------------------- |
| 197 | // No-op entrypoints |
| 198 | |
| 199 | // clang-format off |
| 200 | #pragma clang diagnostic push |
| 201 | #pragma clang diagnostic ignored "-Wunused-parameter" |
| 202 | |
| 203 | VkResult GetPhysicalDeviceQueueCount(VkPhysicalDevice physicalDevice, uint32_t* pCount) { |
| 204 | return VK_SUCCESS; |
| 205 | } |
| 206 | |
| 207 | VkResult GetPhysicalDeviceQueueProperties(VkPhysicalDevice physicalDevice, uint32_t count, VkPhysicalDeviceQueueProperties* pQueueProperties) { |
| 208 | return VK_SUCCESS; |
| 209 | } |
| 210 | |
| 211 | VkResult GetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties) { |
| 212 | return VK_SUCCESS; |
| 213 | } |
| 214 | |
| 215 | VkResult GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) { |
| 216 | return VK_SUCCESS; |
| 217 | } |
| 218 | |
| 219 | VkResult GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) { |
| 220 | return VK_SUCCESS; |
| 221 | } |
| 222 | |
| 223 | VkResult GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageFormatProperties* pImageFormatProperties) { |
| 224 | return VK_SUCCESS; |
| 225 | } |
| 226 | |
| 227 | VkResult GetPhysicalDeviceLimits(VkPhysicalDevice physicalDevice, VkPhysicalDeviceLimits* pLimits) { |
| 228 | return VK_SUCCESS; |
| 229 | } |
| 230 | |
| 231 | VkResult GetGlobalLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties) { |
| 232 | return VK_SUCCESS; |
| 233 | } |
| 234 | |
| 235 | VkResult GetPhysicalDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties) { |
| 236 | return VK_SUCCESS; |
| 237 | } |
| 238 | |
| 239 | VkResult GetPhysicalDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties) { |
| 240 | return VK_SUCCESS; |
| 241 | } |
| 242 | |
| 243 | VkResult QueueSubmit(VkQueue queue, uint32_t cmdBufferCount, const VkCmdBuffer* pCmdBuffers, VkFence fence) { |
| 244 | return VK_SUCCESS; |
| 245 | } |
| 246 | |
| 247 | VkResult QueueWaitIdle(VkQueue queue) { |
| 248 | return VK_SUCCESS; |
| 249 | } |
| 250 | |
| 251 | VkResult DeviceWaitIdle(VkDevice device) { |
| 252 | return VK_SUCCESS; |
| 253 | } |
| 254 | |
| 255 | VkResult AllocMemory(VkDevice device, const VkMemoryAllocInfo* pAllocInfo, VkDeviceMemory* pMem) { |
| 256 | return VK_SUCCESS; |
| 257 | } |
| 258 | |
| 259 | VkResult FreeMemory(VkDevice device, VkDeviceMemory mem) { |
| 260 | return VK_SUCCESS; |
| 261 | } |
| 262 | |
| 263 | VkResult MapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData) { |
| 264 | return VK_SUCCESS; |
| 265 | } |
| 266 | |
| 267 | VkResult UnmapMemory(VkDevice device, VkDeviceMemory mem) { |
| 268 | return VK_SUCCESS; |
| 269 | } |
| 270 | |
| 271 | VkResult FlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) { |
| 272 | return VK_SUCCESS; |
| 273 | } |
| 274 | |
| 275 | VkResult InvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) { |
| 276 | return VK_SUCCESS; |
| 277 | } |
| 278 | |
| 279 | VkResult GetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) { |
| 280 | return VK_SUCCESS; |
| 281 | } |
| 282 | |
| 283 | VkResult GetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements) { |
| 284 | return VK_SUCCESS; |
| 285 | } |
| 286 | |
| 287 | VkResult BindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memOffset) { |
| 288 | return VK_SUCCESS; |
| 289 | } |
| 290 | |
| 291 | VkResult GetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements) { |
| 292 | return VK_SUCCESS; |
| 293 | } |
| 294 | |
| 295 | VkResult BindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memOffset) { |
| 296 | return VK_SUCCESS; |
| 297 | } |
| 298 | |
| 299 | VkResult GetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pNumRequirements, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) { |
| 300 | return VK_SUCCESS; |
| 301 | } |
| 302 | |
| 303 | VkResult GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, uint32_t samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pNumProperties, VkSparseImageFormatProperties* pProperties) { |
| 304 | return VK_SUCCESS; |
| 305 | } |
| 306 | |
| 307 | VkResult QueueBindSparseBufferMemory(VkQueue queue, VkBuffer buffer, uint32_t numBindings, const VkSparseMemoryBindInfo* pBindInfo) { |
| 308 | return VK_SUCCESS; |
| 309 | } |
| 310 | |
| 311 | VkResult QueueBindSparseImageOpaqueMemory(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseMemoryBindInfo* pBindInfo) { |
| 312 | return VK_SUCCESS; |
| 313 | } |
| 314 | |
| 315 | VkResult QueueBindSparseImageMemory(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseImageMemoryBindInfo* pBindInfo) { |
| 316 | return VK_SUCCESS; |
| 317 | } |
| 318 | |
| 319 | VkResult CreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, VkFence* pFence) { |
| 320 | return VK_SUCCESS; |
| 321 | } |
| 322 | |
| 323 | VkResult DestroyFence(VkDevice device, VkFence fence) { |
| 324 | return VK_SUCCESS; |
| 325 | } |
| 326 | |
| 327 | VkResult ResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) { |
| 328 | return VK_SUCCESS; |
| 329 | } |
| 330 | |
| 331 | VkResult GetFenceStatus(VkDevice device, VkFence fence) { |
| 332 | return VK_SUCCESS; |
| 333 | } |
| 334 | |
| 335 | VkResult WaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) { |
| 336 | return VK_SUCCESS; |
| 337 | } |
| 338 | |
| 339 | VkResult CreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, VkSemaphore* pSemaphore) { |
| 340 | return VK_SUCCESS; |
| 341 | } |
| 342 | |
| 343 | VkResult DestroySemaphore(VkDevice device, VkSemaphore semaphore) { |
| 344 | return VK_SUCCESS; |
| 345 | } |
| 346 | |
| 347 | VkResult QueueSignalSemaphore(VkQueue queue, VkSemaphore semaphore) { |
| 348 | return VK_SUCCESS; |
| 349 | } |
| 350 | |
| 351 | VkResult QueueWaitSemaphore(VkQueue queue, VkSemaphore semaphore) { |
| 352 | return VK_SUCCESS; |
| 353 | } |
| 354 | |
| 355 | VkResult CreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, VkEvent* pEvent) { |
| 356 | return VK_SUCCESS; |
| 357 | } |
| 358 | |
| 359 | VkResult DestroyEvent(VkDevice device, VkEvent event) { |
| 360 | return VK_SUCCESS; |
| 361 | } |
| 362 | |
| 363 | VkResult GetEventStatus(VkDevice device, VkEvent event) { |
| 364 | return VK_SUCCESS; |
| 365 | } |
| 366 | |
| 367 | VkResult SetEvent(VkDevice device, VkEvent event) { |
| 368 | return VK_SUCCESS; |
| 369 | } |
| 370 | |
| 371 | VkResult ResetEvent(VkDevice device, VkEvent event) { |
| 372 | return VK_SUCCESS; |
| 373 | } |
| 374 | |
| 375 | VkResult CreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, VkQueryPool* pQueryPool) { |
| 376 | return VK_SUCCESS; |
| 377 | } |
| 378 | |
| 379 | VkResult DestroyQueryPool(VkDevice device, VkQueryPool queryPool) { |
| 380 | return VK_SUCCESS; |
| 381 | } |
| 382 | |
| 383 | VkResult GetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, size_t* pDataSize, void* pData, VkQueryResultFlags flags) { |
| 384 | return VK_SUCCESS; |
| 385 | } |
| 386 | |
| 387 | VkResult CreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, VkBuffer* pBuffer) { |
| 388 | return VK_SUCCESS; |
| 389 | } |
| 390 | |
| 391 | VkResult DestroyBuffer(VkDevice device, VkBuffer buffer) { |
| 392 | return VK_SUCCESS; |
| 393 | } |
| 394 | |
| 395 | VkResult CreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, VkBufferView* pView) { |
| 396 | return VK_SUCCESS; |
| 397 | } |
| 398 | |
| 399 | VkResult DestroyBufferView(VkDevice device, VkBufferView bufferView) { |
| 400 | return VK_SUCCESS; |
| 401 | } |
| 402 | |
| 403 | VkResult CreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, VkImage* pImage) { |
| 404 | return VK_SUCCESS; |
| 405 | } |
| 406 | |
| 407 | VkResult DestroyImage(VkDevice device, VkImage image) { |
| 408 | return VK_SUCCESS; |
| 409 | } |
| 410 | |
| 411 | VkResult GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) { |
| 412 | return VK_SUCCESS; |
| 413 | } |
| 414 | |
| 415 | VkResult CreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, VkImageView* pView) { |
| 416 | return VK_SUCCESS; |
| 417 | } |
| 418 | |
| 419 | VkResult DestroyImageView(VkDevice device, VkImageView imageView) { |
| 420 | return VK_SUCCESS; |
| 421 | } |
| 422 | |
| 423 | VkResult CreateAttachmentView(VkDevice device, const VkAttachmentViewCreateInfo* pCreateInfo, VkAttachmentView* pView) { |
| 424 | return VK_SUCCESS; |
| 425 | } |
| 426 | |
| 427 | VkResult DestroyAttachmentView(VkDevice device, VkAttachmentView attachmentView) { |
| 428 | return VK_SUCCESS; |
| 429 | } |
| 430 | |
| 431 | VkResult CreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, VkShaderModule* pShaderModule) { |
| 432 | return VK_SUCCESS; |
| 433 | } |
| 434 | |
| 435 | VkResult DestroyShaderModule(VkDevice device, VkShaderModule shaderModule) { |
| 436 | return VK_SUCCESS; |
| 437 | } |
| 438 | |
| 439 | VkResult CreateShader(VkDevice device, const VkShaderCreateInfo* pCreateInfo, VkShader* pShader) { |
| 440 | return VK_SUCCESS; |
| 441 | } |
| 442 | |
| 443 | VkResult DestroyShader(VkDevice device, VkShader shader) { |
| 444 | return VK_SUCCESS; |
| 445 | } |
| 446 | |
| 447 | VkResult CreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, VkPipelineCache* pPipelineCache) { |
| 448 | return VK_SUCCESS; |
| 449 | } |
| 450 | |
| 451 | VkResult DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache) { |
| 452 | return VK_SUCCESS; |
| 453 | } |
| 454 | |
| 455 | size_t GetPipelineCacheSize(VkDevice device, VkPipelineCache pipelineCache) { |
| 456 | return VK_SUCCESS; |
| 457 | } |
| 458 | |
| 459 | VkResult GetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, void* pData) { |
| 460 | return VK_SUCCESS; |
| 461 | } |
| 462 | |
| 463 | VkResult MergePipelineCaches(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) { |
| 464 | return VK_SUCCESS; |
| 465 | } |
| 466 | |
| 467 | VkResult CreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkGraphicsPipelineCreateInfo* pCreateInfos, VkPipeline* pPipelines) { |
| 468 | return VK_SUCCESS; |
| 469 | } |
| 470 | |
| 471 | VkResult CreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkComputePipelineCreateInfo* pCreateInfos, VkPipeline* pPipelines) { |
| 472 | return VK_SUCCESS; |
| 473 | } |
| 474 | |
| 475 | VkResult DestroyPipeline(VkDevice device, VkPipeline pipeline) { |
| 476 | return VK_SUCCESS; |
| 477 | } |
| 478 | |
| 479 | VkResult CreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, VkPipelineLayout* pPipelineLayout) { |
| 480 | return VK_SUCCESS; |
| 481 | } |
| 482 | |
| 483 | VkResult DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout) { |
| 484 | return VK_SUCCESS; |
| 485 | } |
| 486 | |
| 487 | VkResult CreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, VkSampler* pSampler) { |
| 488 | return VK_SUCCESS; |
| 489 | } |
| 490 | |
| 491 | VkResult DestroySampler(VkDevice device, VkSampler sampler) { |
| 492 | return VK_SUCCESS; |
| 493 | } |
| 494 | |
| 495 | VkResult CreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayout* pSetLayout) { |
| 496 | return VK_SUCCESS; |
| 497 | } |
| 498 | |
| 499 | VkResult DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout) { |
| 500 | return VK_SUCCESS; |
| 501 | } |
| 502 | |
| 503 | VkResult CreateDescriptorPool(VkDevice device, VkDescriptorPoolUsage poolUsage, uint32_t maxSets, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool) { |
| 504 | return VK_SUCCESS; |
| 505 | } |
| 506 | |
| 507 | VkResult DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool) { |
| 508 | return VK_SUCCESS; |
| 509 | } |
| 510 | |
| 511 | VkResult ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool) { |
| 512 | return VK_SUCCESS; |
| 513 | } |
| 514 | |
| 515 | VkResult AllocDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets, uint32_t* pCount) { |
| 516 | return VK_SUCCESS; |
| 517 | } |
| 518 | |
| 519 | VkResult UpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies) { |
| 520 | return VK_SUCCESS; |
| 521 | } |
| 522 | |
| 523 | VkResult FreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets) { |
| 524 | return VK_SUCCESS; |
| 525 | } |
| 526 | |
| 527 | VkResult CreateDynamicViewportState(VkDevice device, const VkDynamicViewportStateCreateInfo* pCreateInfo, VkDynamicViewportState* pState) { |
| 528 | return VK_SUCCESS; |
| 529 | } |
| 530 | |
| 531 | VkResult DestroyDynamicViewportState(VkDevice device, VkDynamicViewportState dynamicViewportState) { |
| 532 | return VK_SUCCESS; |
| 533 | } |
| 534 | |
| 535 | VkResult CreateDynamicRasterState(VkDevice device, const VkDynamicRasterStateCreateInfo* pCreateInfo, VkDynamicRasterState* pState) { |
| 536 | return VK_SUCCESS; |
| 537 | } |
| 538 | |
| 539 | VkResult DestroyDynamicRasterState(VkDevice device, VkDynamicRasterState dynamicRasterState) { |
| 540 | return VK_SUCCESS; |
| 541 | } |
| 542 | |
| 543 | VkResult CreateDynamicColorBlendState(VkDevice device, const VkDynamicColorBlendStateCreateInfo* pCreateInfo, VkDynamicColorBlendState* pState) { |
| 544 | return VK_SUCCESS; |
| 545 | } |
| 546 | |
| 547 | VkResult DestroyDynamicColorBlendState(VkDevice device, VkDynamicColorBlendState dynamicColorBlendState) { |
| 548 | return VK_SUCCESS; |
| 549 | } |
| 550 | |
| 551 | VkResult CreateDynamicDepthStencilState(VkDevice device, const VkDynamicDepthStencilStateCreateInfo* pCreateInfo, VkDynamicDepthStencilState* pState) { |
| 552 | return VK_SUCCESS; |
| 553 | } |
| 554 | |
| 555 | VkResult DestroyDynamicDepthStencilState(VkDevice device, VkDynamicDepthStencilState dynamicDepthStencilState) { |
| 556 | return VK_SUCCESS; |
| 557 | } |
| 558 | |
| 559 | VkResult CreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, VkFramebuffer* pFramebuffer) { |
| 560 | return VK_SUCCESS; |
| 561 | } |
| 562 | |
| 563 | VkResult DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer) { |
| 564 | return VK_SUCCESS; |
| 565 | } |
| 566 | |
| 567 | VkResult CreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, VkRenderPass* pRenderPass) { |
| 568 | return VK_SUCCESS; |
| 569 | } |
| 570 | |
| 571 | VkResult DestroyRenderPass(VkDevice device, VkRenderPass renderPass) { |
| 572 | return VK_SUCCESS; |
| 573 | } |
| 574 | |
| 575 | VkResult GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) { |
| 576 | return VK_SUCCESS; |
| 577 | } |
| 578 | |
| 579 | VkResult CreateCommandPool(VkDevice device, const VkCmdPoolCreateInfo* pCreateInfo, VkCmdPool* pCmdPool) { |
| 580 | return VK_SUCCESS; |
| 581 | } |
| 582 | |
| 583 | VkResult DestroyCommandPool(VkDevice device, VkCmdPool cmdPool) { |
| 584 | return VK_SUCCESS; |
| 585 | } |
| 586 | |
| 587 | VkResult ResetCommandPool(VkDevice device, VkCmdPool cmdPool, VkCmdPoolResetFlags flags) { |
| 588 | return VK_SUCCESS; |
| 589 | } |
| 590 | |
| 591 | VkResult CreateCommandBuffer(VkDevice device, const VkCmdBufferCreateInfo* pCreateInfo, VkCmdBuffer* pCmdBuffer) { |
| 592 | return VK_SUCCESS; |
| 593 | } |
| 594 | |
| 595 | VkResult DestroyCommandBuffer(VkDevice device, VkCmdBuffer commandBuffer) { |
| 596 | return VK_SUCCESS; |
| 597 | } |
| 598 | |
| 599 | VkResult BeginCommandBuffer(VkCmdBuffer cmdBuffer, const VkCmdBufferBeginInfo* pBeginInfo) { |
| 600 | return VK_SUCCESS; |
| 601 | } |
| 602 | |
| 603 | VkResult EndCommandBuffer(VkCmdBuffer cmdBuffer) { |
| 604 | return VK_SUCCESS; |
| 605 | } |
| 606 | |
| 607 | VkResult ResetCommandBuffer(VkCmdBuffer cmdBuffer, VkCmdBufferResetFlags flags) { |
| 608 | return VK_SUCCESS; |
| 609 | } |
| 610 | |
| 611 | void CmdBindPipeline(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) { |
| 612 | } |
| 613 | |
| 614 | void CmdBindDynamicViewportState(VkCmdBuffer cmdBuffer, VkDynamicViewportState dynamicViewportState) { |
| 615 | } |
| 616 | |
| 617 | void CmdBindDynamicRasterState(VkCmdBuffer cmdBuffer, VkDynamicRasterState dynamicRasterState) { |
| 618 | } |
| 619 | |
| 620 | void CmdBindDynamicColorBlendState(VkCmdBuffer cmdBuffer, VkDynamicColorBlendState dynamicColorBlendState) { |
| 621 | } |
| 622 | |
| 623 | void CmdBindDynamicDepthStencilState(VkCmdBuffer cmdBuffer, VkDynamicDepthStencilState dynamicDepthStencilState) { |
| 624 | } |
| 625 | |
| 626 | void CmdBindDescriptorSets(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) { |
| 627 | } |
| 628 | |
| 629 | void CmdBindIndexBuffer(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) { |
| 630 | } |
| 631 | |
| 632 | void CmdBindVertexBuffers(VkCmdBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) { |
| 633 | } |
| 634 | |
| 635 | void CmdDraw(VkCmdBuffer cmdBuffer, uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount) { |
| 636 | } |
| 637 | |
| 638 | void CmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t firstIndex, uint32_t indexCount, int32_t vertexOffset, uint32_t firstInstance, uint32_t instanceCount) { |
| 639 | } |
| 640 | |
| 641 | void CmdDrawIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) { |
| 642 | } |
| 643 | |
| 644 | void CmdDrawIndexedIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) { |
| 645 | } |
| 646 | |
| 647 | void CmdDispatch(VkCmdBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z) { |
| 648 | } |
| 649 | |
| 650 | void CmdDispatchIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset) { |
| 651 | } |
| 652 | |
| 653 | void CmdCopyBuffer(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkBuffer destBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) { |
| 654 | } |
| 655 | |
| 656 | void CmdCopyImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) { |
| 657 | } |
| 658 | |
| 659 | void CmdBlitImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkTexFilter filter) { |
| 660 | } |
| 661 | |
| 662 | void CmdCopyBufferToImage(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) { |
| 663 | } |
| 664 | |
| 665 | void CmdCopyImageToBuffer(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer destBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) { |
| 666 | } |
| 667 | |
| 668 | void CmdUpdateBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const uint32_t* pData) { |
| 669 | } |
| 670 | |
| 671 | void CmdFillBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data) { |
| 672 | } |
| 673 | |
| 674 | void CmdClearColorImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) { |
| 675 | } |
| 676 | |
| 677 | void CmdClearDepthStencilImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) { |
| 678 | } |
| 679 | |
| 680 | void CmdClearColorAttachment(VkCmdBuffer cmdBuffer, uint32_t colorAttachment, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rectCount, const VkRect3D* pRects) { |
| 681 | } |
| 682 | |
| 683 | void CmdClearDepthStencilAttachment(VkCmdBuffer cmdBuffer, VkImageAspectFlags imageAspectMask, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rectCount, const VkRect3D* pRects) { |
| 684 | } |
| 685 | |
| 686 | void CmdResolveImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) { |
| 687 | } |
| 688 | |
| 689 | void CmdSetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
| 690 | } |
| 691 | |
| 692 | void CmdResetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask) { |
| 693 | } |
| 694 | |
| 695 | void CmdWaitEvents(VkCmdBuffer cmdBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags destStageMask, uint32_t memBarrierCount, const void* const* ppMemBarriers) { |
| 696 | } |
| 697 | |
| 698 | void CmdPipelineBarrier(VkCmdBuffer cmdBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags destStageMask, VkBool32 byRegion, uint32_t memBarrierCount, const void* const* ppMemBarriers) { |
| 699 | } |
| 700 | |
| 701 | void CmdBeginQuery(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkQueryControlFlags flags) { |
| 702 | } |
| 703 | |
| 704 | void CmdEndQuery(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot) { |
| 705 | } |
| 706 | |
| 707 | void CmdResetQueryPool(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount) { |
| 708 | } |
| 709 | |
| 710 | void CmdWriteTimestamp(VkCmdBuffer cmdBuffer, VkTimestampType timestampType, VkBuffer destBuffer, VkDeviceSize destOffset) { |
| 711 | } |
| 712 | |
| 713 | void CmdCopyQueryPoolResults(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize destStride, VkQueryResultFlags flags) { |
| 714 | } |
| 715 | |
| 716 | void CmdPushConstants(VkCmdBuffer cmdBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t start, uint32_t length, const void* values) { |
| 717 | } |
| 718 | |
| 719 | void CmdBeginRenderPass(VkCmdBuffer cmdBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkRenderPassContents contents) { |
| 720 | } |
| 721 | |
| 722 | void CmdNextSubpass(VkCmdBuffer cmdBuffer, VkRenderPassContents contents) { |
| 723 | } |
| 724 | |
| 725 | void CmdEndRenderPass(VkCmdBuffer cmdBuffer) { |
| 726 | } |
| 727 | |
| 728 | void CmdExecuteCommands(VkCmdBuffer cmdBuffer, uint32_t cmdBuffersCount, const VkCmdBuffer* pCmdBuffers) { |
| 729 | } |
| 730 | |
| 731 | #pragma clang diagnostic pop |
| 732 | // clang-format on |
| 733 | |
| 734 | } // namespace null_driver |