started adding vulkan icd
[kazan.git] / src / vulkan_icd / vulkan_icd.cpp
1 /*
2 * Copyright 2017 Jacob Lifshay
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in all
12 * copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 * SOFTWARE.
21 *
22 */
23 #include "vulkan_icd.h"
24 #include "util/string_view.h"
25 #include <initializer_list>
26 #include <iostream>
27
28 using namespace vulkan_cpu;
29
30 #ifdef __ELF__
31 #define DLLEXPORT_ATTR(original_attributes) \
32 __attribute__((visibility("default"))) original_attributes
33 #define DLLEXPORT_CALL(original_attributes) original_attributes
34 #elif defined(_WIN32)
35 #define DLLEXPORT_ATTR(original_attributes) __declspec(dllexport) original_attributes
36 #define DLLEXPORT_CALL(original_attributes) original_attributes
37 #else
38 #error DLLEXPORT_* macros not implemented for platform
39 #endif
40
41 extern "C" DLLEXPORT_ATTR(VKAPI_ATTR) PFN_vkVoidFunction DLLEXPORT_CALL(VKAPI_CALL)
42 vk_icdGetInstanceProcAddr(VkInstance instance, const char *name)
43 {
44 return vulkan_icd::Vulkan_loader_interface::get()->get_instance_proc_addr(instance, name);
45 }
46
47 static_assert(static_cast<PFN_vk_icdGetInstanceProcAddr>(&vk_icdGetInstanceProcAddr), "");
48
49 static constexpr void validate_allocator(const VkAllocationCallbacks *allocator) noexcept
50 {
51 assert(allocator == nullptr && "Vulkan allocation callbacks are not implemented");
52 }
53
54 extern "C" VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance,
55 const char *name)
56 {
57 return vk_icdGetInstanceProcAddr(instance, name);
58 }
59
60 static_assert(static_cast<PFN_vkGetInstanceProcAddr>(&vkGetInstanceProcAddr), "");
61
62 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *create_info,
63 const VkAllocationCallbacks *allocator,
64 VkInstance *instance)
65 {
66 return vulkan_icd::Vulkan_loader_interface::get()->create_instance(
67 create_info, allocator, instance);
68 }
69
70 static_assert(static_cast<PFN_vkCreateInstance>(&vkCreateInstance), "");
71
72 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties(
73 const char *layer_name, uint32_t *property_count, VkExtensionProperties *properties)
74
75 {
76 return vulkan_icd::Vulkan_loader_interface::get()->enumerate_instance_extension_properties(
77 layer_name, property_count, properties);
78 }
79
80 static_assert(static_cast<PFN_vkEnumerateInstanceExtensionProperties>(
81 &vkEnumerateInstanceExtensionProperties),
82 "");
83
84 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(VkInstance instance,
85 const VkAllocationCallbacks *allocator)
86 {
87 validate_allocator(allocator);
88 vulkan::Vulkan_instance::move_from_handle(instance).reset();
89 }
90
91 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices(
92 VkInstance instance, uint32_t *physical_device_count, VkPhysicalDevice *physical_devices)
93 {
94 assert(instance);
95 return vulkan_icd::catch_exceptions_and_return_result(
96 [&]()
97 {
98 auto *instance_pointer = vulkan::Vulkan_instance::from_handle(instance);
99 return vulkan_icd::vulkan_enumerate_list_helper(
100 physical_device_count,
101 physical_devices,
102 {
103 to_handle(&instance_pointer->physical_device),
104 });
105 });
106 }
107
108 extern "C" VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures(
109 VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures)
110 {
111 #warning finish implementing vkGetPhysicalDeviceFeatures
112 assert(!"vkGetPhysicalDeviceFeatures is not implemented");
113 }
114
115 extern "C" VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties(
116 VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatProperties)
117 {
118 #warning finish implementing vkGetPhysicalDeviceFormatProperties
119 assert(!"vkGetPhysicalDeviceFormatProperties is not implemented");
120 }
121
122 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
123 vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice,
124 VkFormat format,
125 VkImageType type,
126 VkImageTiling tiling,
127 VkImageUsageFlags usage,
128 VkImageCreateFlags flags,
129 VkImageFormatProperties *pImageFormatProperties)
130 {
131 #warning finish implementing vkGetPhysicalDeviceImageFormatProperties
132 assert(!"vkGetPhysicalDeviceImageFormatProperties is not implemented");
133 }
134
135 extern "C" VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties(
136 VkPhysicalDevice physical_device, VkPhysicalDeviceProperties *properties)
137 {
138 assert(physical_device);
139 assert(properties);
140 auto *physical_device_pointer = vulkan::Vulkan_physical_device::from_handle(physical_device);
141 *properties = physical_device_pointer->properties;
142 }
143
144 extern "C" VKAPI_ATTR void VKAPI_CALL
145 vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice,
146 uint32_t *pQueueFamilyPropertyCount,
147 VkQueueFamilyProperties *pQueueFamilyProperties)
148 {
149 #warning finish implementing vkGetPhysicalDeviceQueueFamilyProperties
150 assert(!"vkGetPhysicalDeviceQueueFamilyProperties is not implemented");
151 }
152
153 extern "C" VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(
154 VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties *pMemoryProperties)
155 {
156 #warning finish implementing vkGetPhysicalDeviceMemoryProperties
157 assert(!"vkGetPhysicalDeviceMemoryProperties is not implemented");
158 }
159
160 extern "C" VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device,
161 const char *name)
162 {
163 return vulkan_icd::Vulkan_loader_interface::get()->get_procedure_address(
164 name, vulkan_icd::Vulkan_loader_interface::Procedure_address_scope::Device);
165 }
166
167 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice,
168 const VkDeviceCreateInfo *pCreateInfo,
169 const VkAllocationCallbacks *allocator,
170 VkDevice *pDevice)
171 {
172 validate_allocator(allocator);
173 #warning finish implementing vkCreateDevice
174 assert(!"vkCreateDevice is not implemented");
175 }
176
177 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyDevice(VkDevice device,
178 const VkAllocationCallbacks *allocator)
179 {
180 validate_allocator(allocator);
181 #warning finish implementing vkDestroyDevice
182 assert(!"vkDestroyDevice is not implemented");
183 }
184
185 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
186 vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physical_device,
187 const char *layer_name,
188 uint32_t *property_count,
189 VkExtensionProperties *properties)
190 {
191 return vulkan_icd::Vulkan_loader_interface::get()->enumerate_device_extension_properties(
192 physical_device, layer_name, property_count, properties);
193 }
194
195 extern "C" VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue(VkDevice device,
196 uint32_t queueFamilyIndex,
197 uint32_t queueIndex,
198 VkQueue *pQueue)
199 {
200 #warning finish implementing vkGetDeviceQueue
201 assert(!"vkGetDeviceQueue is not implemented");
202 }
203
204 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit(VkQueue queue,
205 uint32_t submitCount,
206 const VkSubmitInfo *pSubmits,
207 VkFence fence)
208 {
209 #warning finish implementing vkQueueSubmit
210 assert(!"vkQueueSubmit is not implemented");
211 }
212
213 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue)
214 {
215 #warning finish implementing vkQueueWaitIdle
216 assert(!"vkQueueWaitIdle is not implemented");
217 }
218
219 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device)
220 {
221 #warning finish implementing vkDeviceWaitIdle
222 assert(!"vkDeviceWaitIdle is not implemented");
223 }
224
225 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
226 vkAllocateMemory(VkDevice device,
227 const VkMemoryAllocateInfo *pAllocateInfo,
228 const VkAllocationCallbacks *allocator,
229 VkDeviceMemory *pMemory)
230 {
231 validate_allocator(allocator);
232 #warning finish implementing vkAllocateMemory
233 assert(!"vkAllocateMemory is not implemented");
234 }
235
236 extern "C" VKAPI_ATTR void VKAPI_CALL vkFreeMemory(VkDevice device,
237 VkDeviceMemory memory,
238 const VkAllocationCallbacks *allocator)
239 {
240 validate_allocator(allocator);
241 #warning finish implementing vkFreeMemory
242 assert(!"vkFreeMemory is not implemented");
243 }
244
245 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory(VkDevice device,
246 VkDeviceMemory memory,
247 VkDeviceSize offset,
248 VkDeviceSize size,
249 VkMemoryMapFlags flags,
250 void **ppData)
251 {
252 #warning finish implementing vkMapMemory
253 assert(!"vkMapMemory is not implemented");
254 }
255
256 extern "C" VKAPI_ATTR void VKAPI_CALL vkUnmapMemory(VkDevice device, VkDeviceMemory memory)
257 {
258 #warning finish implementing vkUnmapMemory
259 assert(!"vkUnmapMemory is not implemented");
260 }
261
262 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkFlushMappedMemoryRanges(
263 VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges)
264 {
265 #warning finish implementing vkFlushMappedMemoryRanges
266 assert(!"vkFlushMappedMemoryRanges is not implemented");
267 }
268
269 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkInvalidateMappedMemoryRanges(
270 VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges)
271 {
272 #warning finish implementing vkInvalidateMappedMemoryRanges
273 assert(!"vkInvalidateMappedMemoryRanges is not implemented");
274 }
275
276 extern "C" VKAPI_ATTR void VKAPI_CALL vkGetDeviceMemoryCommitment(
277 VkDevice device, VkDeviceMemory memory, VkDeviceSize *pCommittedMemoryInBytes)
278 {
279 #warning finish implementing vkGetDeviceMemoryCommitment
280 assert(!"vkGetDeviceMemoryCommitment is not implemented");
281 }
282
283 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory(VkDevice device,
284 VkBuffer buffer,
285 VkDeviceMemory memory,
286 VkDeviceSize memoryOffset)
287 {
288 #warning finish implementing vkBindBufferMemory
289 assert(!"vkBindBufferMemory is not implemented");
290 }
291
292 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory(VkDevice device,
293 VkImage image,
294 VkDeviceMemory memory,
295 VkDeviceSize memoryOffset)
296 {
297 #warning finish implementing vkBindImageMemory
298 assert(!"vkBindImageMemory is not implemented");
299 }
300
301 extern "C" VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements(
302 VkDevice device, VkBuffer buffer, VkMemoryRequirements *pMemoryRequirements)
303 {
304 #warning finish implementing vkGetBufferMemoryRequirements
305 assert(!"vkGetBufferMemoryRequirements is not implemented");
306 }
307
308 extern "C" VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements(
309 VkDevice device, VkImage image, VkMemoryRequirements *pMemoryRequirements)
310 {
311 #warning finish implementing vkGetImageMemoryRequirements
312 assert(!"vkGetImageMemoryRequirements is not implemented");
313 }
314
315 extern "C" VKAPI_ATTR void VKAPI_CALL
316 vkGetImageSparseMemoryRequirements(VkDevice device,
317 VkImage image,
318 uint32_t *pSparseMemoryRequirementCount,
319 VkSparseImageMemoryRequirements *pSparseMemoryRequirements)
320 {
321 #warning finish implementing vkGetImageSparseMemoryRequirements
322 assert(!"vkGetImageSparseMemoryRequirements is not implemented");
323 }
324
325 extern "C" VKAPI_ATTR void VKAPI_CALL
326 vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice,
327 VkFormat format,
328 VkImageType type,
329 VkSampleCountFlagBits samples,
330 VkImageUsageFlags usage,
331 VkImageTiling tiling,
332 uint32_t *pPropertyCount,
333 VkSparseImageFormatProperties *pProperties)
334 {
335 #warning finish implementing vkGetPhysicalDeviceSparseImageFormatProperties
336 assert(!"vkGetPhysicalDeviceSparseImageFormatProperties is not implemented");
337 }
338
339 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkQueueBindSparse(VkQueue queue,
340 uint32_t bindInfoCount,
341 const VkBindSparseInfo *pBindInfo,
342 VkFence fence)
343 {
344 #warning finish implementing vkQueueBindSparse
345 assert(!"vkQueueBindSparse is not implemented");
346 }
347
348 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence(VkDevice device,
349 const VkFenceCreateInfo *pCreateInfo,
350 const VkAllocationCallbacks *allocator,
351 VkFence *pFence)
352 {
353 validate_allocator(allocator);
354 #warning finish implementing vkCreateFence
355 assert(!"vkCreateFence is not implemented");
356 }
357
358 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyFence(VkDevice device,
359 VkFence fence,
360 const VkAllocationCallbacks *allocator)
361 {
362 validate_allocator(allocator);
363 #warning finish implementing vkDestroyFence
364 assert(!"vkDestroyFence is not implemented");
365 }
366
367 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkResetFences(VkDevice device,
368 uint32_t fenceCount,
369 const VkFence *pFences)
370 {
371 #warning finish implementing vkResetFences
372 assert(!"vkResetFences is not implemented");
373 }
374
375 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceStatus(VkDevice device, VkFence fence)
376 {
377 #warning finish implementing vkGetFenceStatus
378 assert(!"vkGetFenceStatus is not implemented");
379 }
380
381 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkWaitForFences(VkDevice device,
382 uint32_t fenceCount,
383 const VkFence *pFences,
384 VkBool32 waitAll,
385 uint64_t timeout)
386 {
387 #warning finish implementing vkWaitForFences
388 assert(!"vkWaitForFences is not implemented");
389 }
390
391 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
392 vkCreateSemaphore(VkDevice device,
393 const VkSemaphoreCreateInfo *pCreateInfo,
394 const VkAllocationCallbacks *allocator,
395 VkSemaphore *pSemaphore)
396 {
397 validate_allocator(allocator);
398 #warning finish implementing vkCreateSemaphore
399 assert(!"vkCreateSemaphore is not implemented");
400 }
401
402 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroySemaphore(VkDevice device,
403 VkSemaphore semaphore,
404 const VkAllocationCallbacks *allocator)
405 {
406 validate_allocator(allocator);
407 #warning finish implementing vkDestroySemaphore
408 assert(!"vkDestroySemaphore is not implemented");
409 }
410
411 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent(VkDevice device,
412 const VkEventCreateInfo *pCreateInfo,
413 const VkAllocationCallbacks *allocator,
414 VkEvent *pEvent)
415 {
416 validate_allocator(allocator);
417 #warning finish implementing vkCreateEvent
418 assert(!"vkCreateEvent is not implemented");
419 }
420
421 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyEvent(VkDevice device,
422 VkEvent event,
423 const VkAllocationCallbacks *allocator)
424 {
425 validate_allocator(allocator);
426 #warning finish implementing vkDestroyEvent
427 assert(!"vkDestroyEvent is not implemented");
428 }
429
430 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkGetEventStatus(VkDevice device, VkEvent event)
431 {
432 #warning finish implementing vkGetEventStatus
433 assert(!"vkGetEventStatus is not implemented");
434 }
435
436 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkSetEvent(VkDevice device, VkEvent event)
437 {
438 #warning finish implementing vkSetEvent
439 assert(!"vkSetEvent is not implemented");
440 }
441
442 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkResetEvent(VkDevice device, VkEvent event)
443 {
444 #warning finish implementing vkResetEvent
445 assert(!"vkResetEvent is not implemented");
446 }
447
448 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
449 vkCreateQueryPool(VkDevice device,
450 const VkQueryPoolCreateInfo *pCreateInfo,
451 const VkAllocationCallbacks *allocator,
452 VkQueryPool *pQueryPool)
453 {
454 #warning finish implementing vkCreateQueryPool
455 assert(!"vkCreateQueryPool is not implemented");
456 }
457
458 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyQueryPool(VkDevice device,
459 VkQueryPool queryPool,
460 const VkAllocationCallbacks *allocator)
461 {
462 validate_allocator(allocator);
463 #warning finish implementing vkDestroyQueryPool
464 assert(!"vkDestroyQueryPool is not implemented");
465 }
466
467 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkGetQueryPoolResults(VkDevice device,
468 VkQueryPool queryPool,
469 uint32_t firstQuery,
470 uint32_t queryCount,
471 size_t dataSize,
472 void *pData,
473 VkDeviceSize stride,
474 VkQueryResultFlags flags)
475 {
476 #warning finish implementing vkGetQueryPoolResults
477 assert(!"vkGetQueryPoolResults is not implemented");
478 }
479
480 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkCreateBuffer(VkDevice device,
481 const VkBufferCreateInfo *pCreateInfo,
482 const VkAllocationCallbacks *allocator,
483 VkBuffer *pBuffer)
484 {
485 validate_allocator(allocator);
486 #warning finish implementing vkCreateBuffer
487 assert(!"vkCreateBuffer is not implemented");
488 }
489
490 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyBuffer(VkDevice device,
491 VkBuffer buffer,
492 const VkAllocationCallbacks *allocator)
493 {
494 validate_allocator(allocator);
495 #warning finish implementing vkDestroyBuffer
496 assert(!"vkDestroyBuffer is not implemented");
497 }
498
499 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
500 vkCreateBufferView(VkDevice device,
501 const VkBufferViewCreateInfo *pCreateInfo,
502 const VkAllocationCallbacks *allocator,
503 VkBufferView *pView)
504 {
505 validate_allocator(allocator);
506 #warning finish implementing vkCreateBufferView
507 assert(!"vkCreateBufferView is not implemented");
508 }
509
510 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyBufferView(VkDevice device,
511 VkBufferView bufferView,
512 const VkAllocationCallbacks *allocator)
513 {
514 validate_allocator(allocator);
515 #warning finish implementing vkDestroyBufferView
516 assert(!"vkDestroyBufferView is not implemented");
517 }
518
519 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage(VkDevice device,
520 const VkImageCreateInfo *pCreateInfo,
521 const VkAllocationCallbacks *allocator,
522 VkImage *pImage)
523 {
524 validate_allocator(allocator);
525 #warning finish implementing vkCreateImage
526 assert(!"vkCreateImage is not implemented");
527 }
528
529 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyImage(VkDevice device,
530 VkImage image,
531 const VkAllocationCallbacks *allocator)
532 {
533 validate_allocator(allocator);
534 #warning finish implementing vkDestroyImage
535 assert(!"vkDestroyImage is not implemented");
536 }
537
538 extern "C" VKAPI_ATTR void VKAPI_CALL
539 vkGetImageSubresourceLayout(VkDevice device,
540 VkImage image,
541 const VkImageSubresource *pSubresource,
542 VkSubresourceLayout *pLayout)
543 {
544 #warning finish implementing vkGetImageSubresourceLayout
545 assert(!"vkGetImageSubresourceLayout is not implemented");
546 }
547
548 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
549 vkCreateImageView(VkDevice device,
550 const VkImageViewCreateInfo *pCreateInfo,
551 const VkAllocationCallbacks *allocator,
552 VkImageView *pView)
553 {
554 validate_allocator(allocator);
555 #warning finish implementing vkCreateImageView
556 assert(!"vkCreateImageView is not implemented");
557 }
558
559 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyImageView(VkDevice device,
560 VkImageView imageView,
561 const VkAllocationCallbacks *allocator)
562 {
563 validate_allocator(allocator);
564 #warning finish implementing vkDestroyImageView
565 assert(!"vkDestroyImageView is not implemented");
566 }
567
568 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
569 vkCreateShaderModule(VkDevice device,
570 const VkShaderModuleCreateInfo *pCreateInfo,
571 const VkAllocationCallbacks *allocator,
572 VkShaderModule *pShaderModule)
573 {
574 validate_allocator(allocator);
575 #warning finish implementing vkCreateShaderModule
576 assert(!"vkCreateShaderModule is not implemented");
577 }
578
579 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyShaderModule(VkDevice device,
580 VkShaderModule shaderModule,
581 const VkAllocationCallbacks *allocator)
582 {
583 validate_allocator(allocator);
584 #warning finish implementing vkDestroyShaderModule
585 assert(!"vkDestroyShaderModule is not implemented");
586 }
587
588 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
589 vkCreatePipelineCache(VkDevice device,
590 const VkPipelineCacheCreateInfo *pCreateInfo,
591 const VkAllocationCallbacks *allocator,
592 VkPipelineCache *pPipelineCache)
593 {
594 validate_allocator(allocator);
595 #warning finish implementing vkCreatePipelineCache
596 assert(!"vkCreatePipelineCache is not implemented");
597 }
598
599 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineCache(VkDevice device,
600 VkPipelineCache pipelineCache,
601 const VkAllocationCallbacks *allocator)
602 {
603 validate_allocator(allocator);
604 #warning finish implementing vkDestroyPipelineCache
605 assert(!"vkDestroyPipelineCache is not implemented");
606 }
607
608 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineCacheData(VkDevice device,
609 VkPipelineCache pipelineCache,
610 size_t *pDataSize,
611 void *pData)
612 {
613 #warning finish implementing vkGetPipelineCacheData
614 assert(!"vkGetPipelineCacheData is not implemented");
615 }
616
617 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkMergePipelineCaches(VkDevice device,
618 VkPipelineCache dstCache,
619 uint32_t srcCacheCount,
620 const VkPipelineCache *pSrcCaches)
621 {
622 #warning finish implementing vkMergePipelineCaches
623 assert(!"vkMergePipelineCaches is not implemented");
624 }
625
626 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
627 vkCreateGraphicsPipelines(VkDevice device,
628 VkPipelineCache pipelineCache,
629 uint32_t createInfoCount,
630 const VkGraphicsPipelineCreateInfo *pCreateInfos,
631 const VkAllocationCallbacks *allocator,
632 VkPipeline *pPipelines)
633 {
634 validate_allocator(allocator);
635 #warning finish implementing vkCreateGraphicsPipelines
636 assert(!"vkCreateGraphicsPipelines is not implemented");
637 }
638
639 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
640 vkCreateComputePipelines(VkDevice device,
641 VkPipelineCache pipelineCache,
642 uint32_t createInfoCount,
643 const VkComputePipelineCreateInfo *pCreateInfos,
644 const VkAllocationCallbacks *allocator,
645 VkPipeline *pPipelines)
646 {
647 validate_allocator(allocator);
648 #warning finish implementing vkCreateComputePipelines
649 assert(!"vkCreateComputePipelines is not implemented");
650 }
651
652 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyPipeline(VkDevice device,
653 VkPipeline pipeline,
654 const VkAllocationCallbacks *allocator)
655 {
656 validate_allocator(allocator);
657 #warning finish implementing vkDestroyPipeline
658 assert(!"vkDestroyPipeline is not implemented");
659 }
660
661 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
662 vkCreatePipelineLayout(VkDevice device,
663 const VkPipelineLayoutCreateInfo *pCreateInfo,
664 const VkAllocationCallbacks *allocator,
665 VkPipelineLayout *pPipelineLayout)
666 {
667 validate_allocator(allocator);
668 #warning finish implementing vkCreatePipelineLayout
669 assert(!"vkCreatePipelineLayout is not implemented");
670 }
671
672 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineLayout(
673 VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks *allocator)
674 {
675 validate_allocator(allocator);
676 #warning finish implementing vkDestroyPipelineLayout
677 assert(!"vkDestroyPipelineLayout is not implemented");
678 }
679
680 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler(VkDevice device,
681 const VkSamplerCreateInfo *pCreateInfo,
682 const VkAllocationCallbacks *allocator,
683 VkSampler *pSampler)
684 {
685 validate_allocator(allocator);
686 #warning finish implementing vkCreateSampler
687 assert(!"vkCreateSampler is not implemented");
688 }
689
690 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroySampler(VkDevice device,
691 VkSampler sampler,
692 const VkAllocationCallbacks *allocator)
693 {
694 validate_allocator(allocator);
695 #warning finish implementing vkDestroySampler
696 assert(!"vkDestroySampler is not implemented");
697 }
698
699 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
700 vkCreateDescriptorSetLayout(VkDevice device,
701 const VkDescriptorSetLayoutCreateInfo *pCreateInfo,
702 const VkAllocationCallbacks *allocator,
703 VkDescriptorSetLayout *pSetLayout)
704 {
705 validate_allocator(allocator);
706 #warning finish implementing vkCreateDescriptorSetLayout
707 assert(!"vkCreateDescriptorSetLayout is not implemented");
708 }
709
710 extern "C" VKAPI_ATTR void VKAPI_CALL
711 vkDestroyDescriptorSetLayout(VkDevice device,
712 VkDescriptorSetLayout descriptorSetLayout,
713 const VkAllocationCallbacks *allocator)
714 {
715 validate_allocator(allocator);
716 #warning finish implementing vkDestroyDescriptorSetLayout
717 assert(!"vkDestroyDescriptorSetLayout is not implemented");
718 }
719
720 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
721 vkCreateDescriptorPool(VkDevice device,
722 const VkDescriptorPoolCreateInfo *pCreateInfo,
723 const VkAllocationCallbacks *allocator,
724 VkDescriptorPool *pDescriptorPool)
725 {
726 validate_allocator(allocator);
727 #warning finish implementing vkCreateDescriptorPool
728 assert(!"vkCreateDescriptorPool is not implemented");
729 }
730
731 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyDescriptorPool(
732 VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks *allocator)
733 {
734 validate_allocator(allocator);
735 #warning finish implementing vkDestroyDescriptorPool
736 assert(!"vkDestroyDescriptorPool is not implemented");
737 }
738
739 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device,
740 VkDescriptorPool descriptorPool,
741 VkDescriptorPoolResetFlags flags)
742 {
743 #warning finish implementing vkResetDescriptorPool
744 assert(!"vkResetDescriptorPool is not implemented");
745 }
746
747 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
748 vkAllocateDescriptorSets(VkDevice device,
749 const VkDescriptorSetAllocateInfo *pAllocateInfo,
750 VkDescriptorSet *pDescriptorSets)
751 {
752 #warning finish implementing vkAllocateDescriptorSets
753 assert(!"vkAllocateDescriptorSets is not implemented");
754 }
755
756 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
757 vkFreeDescriptorSets(VkDevice device,
758 VkDescriptorPool descriptorPool,
759 uint32_t descriptorSetCount,
760 const VkDescriptorSet *pDescriptorSets)
761 {
762 #warning finish implementing vkFreeDescriptorSets
763 assert(!"vkFreeDescriptorSets is not implemented");
764 }
765
766 extern "C" VKAPI_ATTR void VKAPI_CALL
767 vkUpdateDescriptorSets(VkDevice device,
768 uint32_t descriptorWriteCount,
769 const VkWriteDescriptorSet *pDescriptorWrites,
770 uint32_t descriptorCopyCount,
771 const VkCopyDescriptorSet *pDescriptorCopies)
772 {
773 #warning finish implementing vkUpdateDescriptorSets
774 assert(!"vkUpdateDescriptorSets is not implemented");
775 }
776
777 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
778 vkCreateFramebuffer(VkDevice device,
779 const VkFramebufferCreateInfo *pCreateInfo,
780 const VkAllocationCallbacks *allocator,
781 VkFramebuffer *pFramebuffer)
782 {
783 validate_allocator(allocator);
784 #warning finish implementing vkCreateFramebuffer
785 assert(!"vkCreateFramebuffer is not implemented");
786 }
787
788 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyFramebuffer(VkDevice device,
789 VkFramebuffer framebuffer,
790 const VkAllocationCallbacks *allocator)
791 {
792 validate_allocator(allocator);
793 #warning finish implementing vkDestroyFramebuffer
794 assert(!"vkDestroyFramebuffer is not implemented");
795 }
796
797 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
798 vkCreateRenderPass(VkDevice device,
799 const VkRenderPassCreateInfo *pCreateInfo,
800 const VkAllocationCallbacks *allocator,
801 VkRenderPass *pRenderPass)
802 {
803 validate_allocator(allocator);
804 #warning finish implementing vkCreateRenderPass
805 assert(!"vkCreateRenderPass is not implemented");
806 }
807
808 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyRenderPass(VkDevice device,
809 VkRenderPass renderPass,
810 const VkAllocationCallbacks *allocator)
811 {
812 validate_allocator(allocator);
813 #warning finish implementing vkDestroyRenderPass
814 assert(!"vkDestroyRenderPass is not implemented");
815 }
816
817 extern "C" VKAPI_ATTR void VKAPI_CALL vkGetRenderAreaGranularity(VkDevice device,
818 VkRenderPass renderPass,
819 VkExtent2D *pGranularity)
820 {
821 #warning finish implementing vkGetRenderAreaGranularity
822 assert(!"vkGetRenderAreaGranularity is not implemented");
823 }
824
825 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
826 vkCreateCommandPool(VkDevice device,
827 const VkCommandPoolCreateInfo *pCreateInfo,
828 const VkAllocationCallbacks *allocator,
829 VkCommandPool *pCommandPool)
830 {
831 validate_allocator(allocator);
832 #warning finish implementing vkCreateCommandPool
833 assert(!"vkCreateCommandPool is not implemented");
834 }
835
836 extern "C" VKAPI_ATTR void VKAPI_CALL vkDestroyCommandPool(VkDevice device,
837 VkCommandPool commandPool,
838 const VkAllocationCallbacks *allocator)
839 {
840 validate_allocator(allocator);
841 #warning finish implementing vkDestroyCommandPool
842 assert(!"vkDestroyCommandPool is not implemented");
843 }
844
845 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool(VkDevice device,
846 VkCommandPool commandPool,
847 VkCommandPoolResetFlags flags)
848 {
849 #warning finish implementing vkResetCommandPool
850 assert(!"vkResetCommandPool is not implemented");
851 }
852
853 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
854 vkAllocateCommandBuffers(VkDevice device,
855 const VkCommandBufferAllocateInfo *pAllocateInfo,
856 VkCommandBuffer *pCommandBuffers)
857 {
858 #warning finish implementing vkAllocateCommandBuffers
859 assert(!"vkAllocateCommandBuffers is not implemented");
860 }
861
862 extern "C" VKAPI_ATTR void VKAPI_CALL vkFreeCommandBuffers(VkDevice device,
863 VkCommandPool commandPool,
864 uint32_t commandBufferCount,
865 const VkCommandBuffer *pCommandBuffers)
866 {
867 #warning finish implementing vkFreeCommandBuffers
868 assert(!"vkFreeCommandBuffers is not implemented");
869 }
870
871 extern "C" VKAPI_ATTR VkResult VKAPI_CALL
872 vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo)
873 {
874 #warning finish implementing vkBeginCommandBuffer
875 assert(!"vkBeginCommandBuffer is not implemented");
876 }
877
878 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkEndCommandBuffer(VkCommandBuffer commandBuffer)
879 {
880 #warning finish implementing vkEndCommandBuffer
881 assert(!"vkEndCommandBuffer is not implemented");
882 }
883
884 extern "C" VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandBuffer(VkCommandBuffer commandBuffer,
885 VkCommandBufferResetFlags flags)
886 {
887 #warning finish implementing vkResetCommandBuffer
888 assert(!"vkResetCommandBuffer is not implemented");
889 }
890
891 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdBindPipeline(VkCommandBuffer commandBuffer,
892 VkPipelineBindPoint pipelineBindPoint,
893 VkPipeline pipeline)
894 {
895 #warning finish implementing vkCmdBindPipeline
896 assert(!"vkCmdBindPipeline is not implemented");
897 }
898
899 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdSetViewport(VkCommandBuffer commandBuffer,
900 uint32_t firstViewport,
901 uint32_t viewportCount,
902 const VkViewport *pViewports)
903 {
904 #warning finish implementing vkCmdSetViewport
905 assert(!"vkCmdSetViewport is not implemented");
906 }
907
908 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdSetScissor(VkCommandBuffer commandBuffer,
909 uint32_t firstScissor,
910 uint32_t scissorCount,
911 const VkRect2D *pScissors)
912 {
913 #warning finish implementing vkCmdSetScissor
914 assert(!"vkCmdSetScissor is not implemented");
915 }
916
917 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdSetLineWidth(VkCommandBuffer commandBuffer,
918 float lineWidth)
919 {
920 #warning finish implementing vkCmdSetLineWidth
921 assert(!"vkCmdSetLineWidth is not implemented");
922 }
923
924 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBias(VkCommandBuffer commandBuffer,
925 float depthBiasConstantFactor,
926 float depthBiasClamp,
927 float depthBiasSlopeFactor)
928 {
929 #warning finish implementing vkCmdSetDepthBias
930 assert(!"vkCmdSetDepthBias is not implemented");
931 }
932
933 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdSetBlendConstants(VkCommandBuffer commandBuffer,
934 const float blendConstants[4])
935 {
936 #warning finish implementing vkCmdSetBlendConstants
937 assert(!"vkCmdSetBlendConstants is not implemented");
938 }
939
940 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBounds(VkCommandBuffer commandBuffer,
941 float minDepthBounds,
942 float maxDepthBounds)
943 {
944 #warning finish implementing vkCmdSetDepthBounds
945 assert(!"vkCmdSetDepthBounds is not implemented");
946 }
947
948 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer,
949 VkStencilFaceFlags faceMask,
950 uint32_t compareMask)
951 {
952 #warning finish implementing vkCmdSetStencilCompareMask
953 assert(!"vkCmdSetStencilCompareMask is not implemented");
954 }
955
956 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer,
957 VkStencilFaceFlags faceMask,
958 uint32_t writeMask)
959 {
960 #warning finish implementing vkCmdSetStencilWriteMask
961 assert(!"vkCmdSetStencilWriteMask is not implemented");
962 }
963
964 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilReference(VkCommandBuffer commandBuffer,
965 VkStencilFaceFlags faceMask,
966 uint32_t reference)
967 {
968 #warning finish implementing vkCmdSetStencilReference
969 assert(!"vkCmdSetStencilReference is not implemented");
970 }
971
972 extern "C" VKAPI_ATTR void VKAPI_CALL
973 vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer,
974 VkPipelineBindPoint pipelineBindPoint,
975 VkPipelineLayout layout,
976 uint32_t firstSet,
977 uint32_t descriptorSetCount,
978 const VkDescriptorSet *pDescriptorSets,
979 uint32_t dynamicOffsetCount,
980 const uint32_t *pDynamicOffsets)
981 {
982 #warning finish implementing vkCmdBindDescriptorSets
983 assert(!"vkCmdBindDescriptorSets is not implemented");
984 }
985
986 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer,
987 VkBuffer buffer,
988 VkDeviceSize offset,
989 VkIndexType indexType)
990 {
991 #warning finish implementing vkCmdBindIndexBuffer
992 assert(!"vkCmdBindIndexBuffer is not implemented");
993 }
994
995 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer,
996 uint32_t firstBinding,
997 uint32_t bindingCount,
998 const VkBuffer *pBuffers,
999 const VkDeviceSize *pOffsets)
1000 {
1001 #warning finish implementing vkCmdBindVertexBuffers
1002 assert(!"vkCmdBindVertexBuffers is not implemented");
1003 }
1004
1005 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdDraw(VkCommandBuffer commandBuffer,
1006 uint32_t vertexCount,
1007 uint32_t instanceCount,
1008 uint32_t firstVertex,
1009 uint32_t firstInstance)
1010 {
1011 #warning finish implementing vkCmdDraw
1012 assert(!"vkCmdDraw is not implemented");
1013 }
1014
1015 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexed(VkCommandBuffer commandBuffer,
1016 uint32_t indexCount,
1017 uint32_t instanceCount,
1018 uint32_t firstIndex,
1019 int32_t vertexOffset,
1020 uint32_t firstInstance)
1021 {
1022 #warning finish implementing vkCmdDrawIndexed
1023 assert(!"vkCmdDrawIndexed is not implemented");
1024 }
1025
1026 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirect(VkCommandBuffer commandBuffer,
1027 VkBuffer buffer,
1028 VkDeviceSize offset,
1029 uint32_t drawCount,
1030 uint32_t stride)
1031 {
1032 #warning finish implementing vkCmdDrawIndirect
1033 assert(!"vkCmdDrawIndirect is not implemented");
1034 }
1035
1036 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer,
1037 VkBuffer buffer,
1038 VkDeviceSize offset,
1039 uint32_t drawCount,
1040 uint32_t stride)
1041 {
1042 #warning finish implementing vkCmdDrawIndexedIndirect
1043 assert(!"vkCmdDrawIndexedIndirect is not implemented");
1044 }
1045
1046 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdDispatch(VkCommandBuffer commandBuffer,
1047 uint32_t groupCountX,
1048 uint32_t groupCountY,
1049 uint32_t groupCountZ)
1050 {
1051 #warning finish implementing vkCmdDispatch
1052 assert(!"vkCmdDispatch is not implemented");
1053 }
1054
1055 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdDispatchIndirect(VkCommandBuffer commandBuffer,
1056 VkBuffer buffer,
1057 VkDeviceSize offset)
1058 {
1059 #warning finish implementing vkCmdDispatchIndirect
1060 assert(!"vkCmdDispatchIndirect is not implemented");
1061 }
1062
1063 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdCopyBuffer(VkCommandBuffer commandBuffer,
1064 VkBuffer srcBuffer,
1065 VkBuffer dstBuffer,
1066 uint32_t regionCount,
1067 const VkBufferCopy *pRegions)
1068 {
1069 #warning finish implementing vkCmdCopyBuffer
1070 assert(!"vkCmdCopyBuffer is not implemented");
1071 }
1072
1073 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdCopyImage(VkCommandBuffer commandBuffer,
1074 VkImage srcImage,
1075 VkImageLayout srcImageLayout,
1076 VkImage dstImage,
1077 VkImageLayout dstImageLayout,
1078 uint32_t regionCount,
1079 const VkImageCopy *pRegions)
1080 {
1081 #warning finish implementing vkCmdCopyImage
1082 assert(!"vkCmdCopyImage is not implemented");
1083 }
1084
1085 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdBlitImage(VkCommandBuffer commandBuffer,
1086 VkImage srcImage,
1087 VkImageLayout srcImageLayout,
1088 VkImage dstImage,
1089 VkImageLayout dstImageLayout,
1090 uint32_t regionCount,
1091 const VkImageBlit *pRegions,
1092 VkFilter filter)
1093 {
1094 #warning finish implementing vkCmdBlitImage
1095 assert(!"vkCmdBlitImage is not implemented");
1096 }
1097
1098 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer,
1099 VkBuffer srcBuffer,
1100 VkImage dstImage,
1101 VkImageLayout dstImageLayout,
1102 uint32_t regionCount,
1103 const VkBufferImageCopy *pRegions)
1104 {
1105 #warning finish implementing vkCmdCopyBufferToImage
1106 assert(!"vkCmdCopyBufferToImage is not implemented");
1107 }
1108
1109 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer,
1110 VkImage srcImage,
1111 VkImageLayout srcImageLayout,
1112 VkBuffer dstBuffer,
1113 uint32_t regionCount,
1114 const VkBufferImageCopy *pRegions)
1115 {
1116 #warning finish implementing vkCmdCopyImageToBuffer
1117 assert(!"vkCmdCopyImageToBuffer is not implemented");
1118 }
1119
1120 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdUpdateBuffer(VkCommandBuffer commandBuffer,
1121 VkBuffer dstBuffer,
1122 VkDeviceSize dstOffset,
1123 VkDeviceSize dataSize,
1124 const void *pData)
1125 {
1126 #warning finish implementing vkCmdUpdateBuffer
1127 assert(!"vkCmdUpdateBuffer is not implemented");
1128 }
1129
1130 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdFillBuffer(VkCommandBuffer commandBuffer,
1131 VkBuffer dstBuffer,
1132 VkDeviceSize dstOffset,
1133 VkDeviceSize size,
1134 uint32_t data)
1135 {
1136 #warning finish implementing vkCmdFillBuffer
1137 assert(!"vkCmdFillBuffer is not implemented");
1138 }
1139
1140 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdClearColorImage(VkCommandBuffer commandBuffer,
1141 VkImage image,
1142 VkImageLayout imageLayout,
1143 const VkClearColorValue *pColor,
1144 uint32_t rangeCount,
1145 const VkImageSubresourceRange *pRanges)
1146 {
1147 #warning finish implementing vkCmdClearColorImage
1148 assert(!"vkCmdClearColorImage is not implemented");
1149 }
1150
1151 extern "C" VKAPI_ATTR void VKAPI_CALL
1152 vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer,
1153 VkImage image,
1154 VkImageLayout imageLayout,
1155 const VkClearDepthStencilValue *pDepthStencil,
1156 uint32_t rangeCount,
1157 const VkImageSubresourceRange *pRanges)
1158 {
1159 #warning finish implementing vkCmdClearDepthStencilImage
1160 assert(!"vkCmdClearDepthStencilImage is not implemented");
1161 }
1162
1163 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdClearAttachments(VkCommandBuffer commandBuffer,
1164 uint32_t attachmentCount,
1165 const VkClearAttachment *pAttachments,
1166 uint32_t rectCount,
1167 const VkClearRect *pRects)
1168 {
1169 #warning finish implementing vkCmdClearAttachments
1170 assert(!"vkCmdClearAttachments is not implemented");
1171 }
1172
1173 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdResolveImage(VkCommandBuffer commandBuffer,
1174 VkImage srcImage,
1175 VkImageLayout srcImageLayout,
1176 VkImage dstImage,
1177 VkImageLayout dstImageLayout,
1178 uint32_t regionCount,
1179 const VkImageResolve *pRegions)
1180 {
1181 #warning finish implementing vkCmdResolveImage
1182 assert(!"vkCmdResolveImage is not implemented");
1183 }
1184
1185 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdSetEvent(VkCommandBuffer commandBuffer,
1186 VkEvent event,
1187 VkPipelineStageFlags stageMask)
1188 {
1189 #warning finish implementing vkCmdSetEvent
1190 assert(!"vkCmdSetEvent is not implemented");
1191 }
1192
1193 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdResetEvent(VkCommandBuffer commandBuffer,
1194 VkEvent event,
1195 VkPipelineStageFlags stageMask)
1196 {
1197 #warning finish implementing vkCmdResetEvent
1198 assert(!"vkCmdResetEvent is not implemented");
1199 }
1200
1201 extern "C" VKAPI_ATTR void VKAPI_CALL
1202 vkCmdWaitEvents(VkCommandBuffer commandBuffer,
1203 uint32_t eventCount,
1204 const VkEvent *pEvents,
1205 VkPipelineStageFlags srcStageMask,
1206 VkPipelineStageFlags dstStageMask,
1207 uint32_t memoryBarrierCount,
1208 const VkMemoryBarrier *pMemoryBarriers,
1209 uint32_t bufferMemoryBarrierCount,
1210 const VkBufferMemoryBarrier *pBufferMemoryBarriers,
1211 uint32_t imageMemoryBarrierCount,
1212 const VkImageMemoryBarrier *pImageMemoryBarriers)
1213 {
1214 #warning finish implementing vkCmdWaitEvents
1215 assert(!"vkCmdWaitEvents is not implemented");
1216 }
1217
1218 extern "C" VKAPI_ATTR void VKAPI_CALL
1219 vkCmdPipelineBarrier(VkCommandBuffer commandBuffer,
1220 VkPipelineStageFlags srcStageMask,
1221 VkPipelineStageFlags dstStageMask,
1222 VkDependencyFlags dependencyFlags,
1223 uint32_t memoryBarrierCount,
1224 const VkMemoryBarrier *pMemoryBarriers,
1225 uint32_t bufferMemoryBarrierCount,
1226 const VkBufferMemoryBarrier *pBufferMemoryBarriers,
1227 uint32_t imageMemoryBarrierCount,
1228 const VkImageMemoryBarrier *pImageMemoryBarriers)
1229 {
1230 #warning finish implementing vkCmdPipelineBarrier
1231 assert(!"vkCmdPipelineBarrier is not implemented");
1232 }
1233
1234 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdBeginQuery(VkCommandBuffer commandBuffer,
1235 VkQueryPool queryPool,
1236 uint32_t query,
1237 VkQueryControlFlags flags)
1238 {
1239 #warning finish implementing vkCmdBeginQuery
1240 assert(!"vkCmdBeginQuery is not implemented");
1241 }
1242
1243 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdEndQuery(VkCommandBuffer commandBuffer,
1244 VkQueryPool queryPool,
1245 uint32_t query)
1246 {
1247 #warning finish implementing vkCmdEndQuery
1248 assert(!"vkCmdEndQuery is not implemented");
1249 }
1250
1251 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdResetQueryPool(VkCommandBuffer commandBuffer,
1252 VkQueryPool queryPool,
1253 uint32_t firstQuery,
1254 uint32_t queryCount)
1255 {
1256 #warning finish implementing vkCmdResetQueryPool
1257 assert(!"vkCmdResetQueryPool is not implemented");
1258 }
1259
1260 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdWriteTimestamp(VkCommandBuffer commandBuffer,
1261 VkPipelineStageFlagBits pipelineStage,
1262 VkQueryPool queryPool,
1263 uint32_t query)
1264 {
1265 #warning finish implementing vkCmdWriteTimestamp
1266 assert(!"vkCmdWriteTimestamp is not implemented");
1267 }
1268
1269 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer,
1270 VkQueryPool queryPool,
1271 uint32_t firstQuery,
1272 uint32_t queryCount,
1273 VkBuffer dstBuffer,
1274 VkDeviceSize dstOffset,
1275 VkDeviceSize stride,
1276 VkQueryResultFlags flags)
1277 {
1278 #warning finish implementing vkCmdCopyQueryPoolResults
1279 assert(!"vkCmdCopyQueryPoolResults is not implemented");
1280 }
1281
1282 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants(VkCommandBuffer commandBuffer,
1283 VkPipelineLayout layout,
1284 VkShaderStageFlags stageFlags,
1285 uint32_t offset,
1286 uint32_t size,
1287 const void *pValues)
1288 {
1289 #warning finish implementing vkCmdPushConstants
1290 assert(!"vkCmdPushConstants is not implemented");
1291 }
1292
1293 extern "C" VKAPI_ATTR void VKAPI_CALL
1294 vkCmdBeginRenderPass(VkCommandBuffer commandBuffer,
1295 const VkRenderPassBeginInfo *pRenderPassBegin,
1296 VkSubpassContents contents)
1297 {
1298 #warning finish implementing vkCmdBeginRenderPass
1299 assert(!"vkCmdBeginRenderPass is not implemented");
1300 }
1301
1302 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdNextSubpass(VkCommandBuffer commandBuffer,
1303 VkSubpassContents contents)
1304 {
1305 #warning finish implementing vkCmdNextSubpass
1306 assert(!"vkCmdNextSubpass is not implemented");
1307 }
1308
1309 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass(VkCommandBuffer commandBuffer)
1310 {
1311 #warning finish implementing vkCmdEndRenderPass
1312 assert(!"vkCmdEndRenderPass is not implemented");
1313 }
1314
1315 extern "C" VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands(VkCommandBuffer commandBuffer,
1316 uint32_t commandBufferCount,
1317 const VkCommandBuffer *pCommandBuffers)
1318 {
1319 #warning finish implementing vkCmdExecuteCommands
1320 assert(!"vkCmdExecuteCommands is not implemented");
1321 }
1322 namespace vulkan_cpu
1323 {
1324 namespace vulkan_icd
1325 {
1326 Vulkan_loader_interface *Vulkan_loader_interface::get() noexcept
1327 {
1328 static Vulkan_loader_interface vulkan_loader_interface{};
1329 return &vulkan_loader_interface;
1330 }
1331
1332 PFN_vkVoidFunction Vulkan_loader_interface::get_procedure_address(
1333 const char *name, Procedure_address_scope scope) noexcept
1334 {
1335 using namespace util::string_view_literals;
1336 assert(name != "vkEnumerateInstanceLayerProperties"_sv
1337 && "shouldn't be called, implemented by the vulkan loader");
1338 assert(name != "vkEnumerateDeviceLayerProperties"_sv
1339 && "shouldn't be called, implemented by the vulkan loader");
1340
1341 #define LIBRARY_SCOPE_FUNCTION(function_name) \
1342 do \
1343 { \
1344 if(name == #function_name##_sv) \
1345 return reinterpret_cast<PFN_vkVoidFunction>( \
1346 static_cast<PFN_##function_name>(function_name)); \
1347 } while(0)
1348 #define INSTANCE_SCOPE_FUNCTION(function_name) \
1349 do \
1350 { \
1351 if(scope != Procedure_address_scope::Library && name == #function_name##_sv) \
1352 return reinterpret_cast<PFN_vkVoidFunction>( \
1353 static_cast<PFN_##function_name>(function_name)); \
1354 } while(0)
1355
1356 LIBRARY_SCOPE_FUNCTION(vkEnumerateInstanceExtensionProperties);
1357 LIBRARY_SCOPE_FUNCTION(vkCreateInstance);
1358 INSTANCE_SCOPE_FUNCTION(vkDestroyInstance);
1359 INSTANCE_SCOPE_FUNCTION(vkEnumeratePhysicalDevices);
1360 INSTANCE_SCOPE_FUNCTION(vkGetPhysicalDeviceFeatures);
1361 INSTANCE_SCOPE_FUNCTION(vkGetPhysicalDeviceFormatProperties);
1362 INSTANCE_SCOPE_FUNCTION(vkGetPhysicalDeviceImageFormatProperties);
1363 INSTANCE_SCOPE_FUNCTION(vkGetPhysicalDeviceProperties);
1364 INSTANCE_SCOPE_FUNCTION(vkGetPhysicalDeviceQueueFamilyProperties);
1365 INSTANCE_SCOPE_FUNCTION(vkGetPhysicalDeviceMemoryProperties);
1366 INSTANCE_SCOPE_FUNCTION(vkGetInstanceProcAddr);
1367 INSTANCE_SCOPE_FUNCTION(vkGetDeviceProcAddr);
1368 INSTANCE_SCOPE_FUNCTION(vkCreateDevice);
1369 INSTANCE_SCOPE_FUNCTION(vkDestroyDevice);
1370 INSTANCE_SCOPE_FUNCTION(vkEnumerateDeviceExtensionProperties);
1371 INSTANCE_SCOPE_FUNCTION(vkGetDeviceQueue);
1372 INSTANCE_SCOPE_FUNCTION(vkQueueSubmit);
1373 INSTANCE_SCOPE_FUNCTION(vkQueueWaitIdle);
1374 INSTANCE_SCOPE_FUNCTION(vkDeviceWaitIdle);
1375 INSTANCE_SCOPE_FUNCTION(vkAllocateMemory);
1376 INSTANCE_SCOPE_FUNCTION(vkFreeMemory);
1377 INSTANCE_SCOPE_FUNCTION(vkMapMemory);
1378 INSTANCE_SCOPE_FUNCTION(vkUnmapMemory);
1379 INSTANCE_SCOPE_FUNCTION(vkFlushMappedMemoryRanges);
1380 INSTANCE_SCOPE_FUNCTION(vkInvalidateMappedMemoryRanges);
1381 INSTANCE_SCOPE_FUNCTION(vkGetDeviceMemoryCommitment);
1382 INSTANCE_SCOPE_FUNCTION(vkBindBufferMemory);
1383 INSTANCE_SCOPE_FUNCTION(vkBindImageMemory);
1384 INSTANCE_SCOPE_FUNCTION(vkGetBufferMemoryRequirements);
1385 INSTANCE_SCOPE_FUNCTION(vkGetImageMemoryRequirements);
1386 INSTANCE_SCOPE_FUNCTION(vkGetImageSparseMemoryRequirements);
1387 INSTANCE_SCOPE_FUNCTION(vkGetPhysicalDeviceSparseImageFormatProperties);
1388 INSTANCE_SCOPE_FUNCTION(vkQueueBindSparse);
1389 INSTANCE_SCOPE_FUNCTION(vkCreateFence);
1390 INSTANCE_SCOPE_FUNCTION(vkDestroyFence);
1391 INSTANCE_SCOPE_FUNCTION(vkResetFences);
1392 INSTANCE_SCOPE_FUNCTION(vkGetFenceStatus);
1393 INSTANCE_SCOPE_FUNCTION(vkWaitForFences);
1394 INSTANCE_SCOPE_FUNCTION(vkCreateSemaphore);
1395 INSTANCE_SCOPE_FUNCTION(vkDestroySemaphore);
1396 INSTANCE_SCOPE_FUNCTION(vkCreateEvent);
1397 INSTANCE_SCOPE_FUNCTION(vkDestroyEvent);
1398 INSTANCE_SCOPE_FUNCTION(vkGetEventStatus);
1399 INSTANCE_SCOPE_FUNCTION(vkSetEvent);
1400 INSTANCE_SCOPE_FUNCTION(vkResetEvent);
1401 INSTANCE_SCOPE_FUNCTION(vkCreateQueryPool);
1402 INSTANCE_SCOPE_FUNCTION(vkDestroyQueryPool);
1403 INSTANCE_SCOPE_FUNCTION(vkGetQueryPoolResults);
1404 INSTANCE_SCOPE_FUNCTION(vkCreateBuffer);
1405 INSTANCE_SCOPE_FUNCTION(vkDestroyBuffer);
1406 INSTANCE_SCOPE_FUNCTION(vkCreateBufferView);
1407 INSTANCE_SCOPE_FUNCTION(vkDestroyBufferView);
1408 INSTANCE_SCOPE_FUNCTION(vkCreateImage);
1409 INSTANCE_SCOPE_FUNCTION(vkDestroyImage);
1410 INSTANCE_SCOPE_FUNCTION(vkGetImageSubresourceLayout);
1411 INSTANCE_SCOPE_FUNCTION(vkCreateImageView);
1412 INSTANCE_SCOPE_FUNCTION(vkDestroyImageView);
1413 INSTANCE_SCOPE_FUNCTION(vkCreateShaderModule);
1414 INSTANCE_SCOPE_FUNCTION(vkDestroyShaderModule);
1415 INSTANCE_SCOPE_FUNCTION(vkCreatePipelineCache);
1416 INSTANCE_SCOPE_FUNCTION(vkDestroyPipelineCache);
1417 INSTANCE_SCOPE_FUNCTION(vkGetPipelineCacheData);
1418 INSTANCE_SCOPE_FUNCTION(vkMergePipelineCaches);
1419 INSTANCE_SCOPE_FUNCTION(vkCreateGraphicsPipelines);
1420 INSTANCE_SCOPE_FUNCTION(vkCreateComputePipelines);
1421 INSTANCE_SCOPE_FUNCTION(vkDestroyPipeline);
1422 INSTANCE_SCOPE_FUNCTION(vkCreatePipelineLayout);
1423 INSTANCE_SCOPE_FUNCTION(vkDestroyPipelineLayout);
1424 INSTANCE_SCOPE_FUNCTION(vkCreateSampler);
1425 INSTANCE_SCOPE_FUNCTION(vkDestroySampler);
1426 INSTANCE_SCOPE_FUNCTION(vkCreateDescriptorSetLayout);
1427 INSTANCE_SCOPE_FUNCTION(vkDestroyDescriptorSetLayout);
1428 INSTANCE_SCOPE_FUNCTION(vkCreateDescriptorPool);
1429 INSTANCE_SCOPE_FUNCTION(vkDestroyDescriptorPool);
1430 INSTANCE_SCOPE_FUNCTION(vkResetDescriptorPool);
1431 INSTANCE_SCOPE_FUNCTION(vkAllocateDescriptorSets);
1432 INSTANCE_SCOPE_FUNCTION(vkFreeDescriptorSets);
1433 INSTANCE_SCOPE_FUNCTION(vkUpdateDescriptorSets);
1434 INSTANCE_SCOPE_FUNCTION(vkCreateFramebuffer);
1435 INSTANCE_SCOPE_FUNCTION(vkDestroyFramebuffer);
1436 INSTANCE_SCOPE_FUNCTION(vkCreateRenderPass);
1437 INSTANCE_SCOPE_FUNCTION(vkDestroyRenderPass);
1438 INSTANCE_SCOPE_FUNCTION(vkGetRenderAreaGranularity);
1439 INSTANCE_SCOPE_FUNCTION(vkCreateCommandPool);
1440 INSTANCE_SCOPE_FUNCTION(vkDestroyCommandPool);
1441 INSTANCE_SCOPE_FUNCTION(vkResetCommandPool);
1442 INSTANCE_SCOPE_FUNCTION(vkAllocateCommandBuffers);
1443 INSTANCE_SCOPE_FUNCTION(vkFreeCommandBuffers);
1444 INSTANCE_SCOPE_FUNCTION(vkBeginCommandBuffer);
1445 INSTANCE_SCOPE_FUNCTION(vkEndCommandBuffer);
1446 INSTANCE_SCOPE_FUNCTION(vkResetCommandBuffer);
1447 INSTANCE_SCOPE_FUNCTION(vkCmdBindPipeline);
1448 INSTANCE_SCOPE_FUNCTION(vkCmdSetViewport);
1449 INSTANCE_SCOPE_FUNCTION(vkCmdSetScissor);
1450 INSTANCE_SCOPE_FUNCTION(vkCmdSetLineWidth);
1451 INSTANCE_SCOPE_FUNCTION(vkCmdSetDepthBias);
1452 INSTANCE_SCOPE_FUNCTION(vkCmdSetBlendConstants);
1453 INSTANCE_SCOPE_FUNCTION(vkCmdSetDepthBounds);
1454 INSTANCE_SCOPE_FUNCTION(vkCmdSetStencilCompareMask);
1455 INSTANCE_SCOPE_FUNCTION(vkCmdSetStencilWriteMask);
1456 INSTANCE_SCOPE_FUNCTION(vkCmdSetStencilReference);
1457 INSTANCE_SCOPE_FUNCTION(vkCmdBindDescriptorSets);
1458 INSTANCE_SCOPE_FUNCTION(vkCmdBindIndexBuffer);
1459 INSTANCE_SCOPE_FUNCTION(vkCmdBindVertexBuffers);
1460 INSTANCE_SCOPE_FUNCTION(vkCmdDraw);
1461 INSTANCE_SCOPE_FUNCTION(vkCmdDrawIndexed);
1462 INSTANCE_SCOPE_FUNCTION(vkCmdDrawIndirect);
1463 INSTANCE_SCOPE_FUNCTION(vkCmdDrawIndexedIndirect);
1464 INSTANCE_SCOPE_FUNCTION(vkCmdDispatch);
1465 INSTANCE_SCOPE_FUNCTION(vkCmdDispatchIndirect);
1466 INSTANCE_SCOPE_FUNCTION(vkCmdCopyBuffer);
1467 INSTANCE_SCOPE_FUNCTION(vkCmdCopyImage);
1468 INSTANCE_SCOPE_FUNCTION(vkCmdBlitImage);
1469 INSTANCE_SCOPE_FUNCTION(vkCmdCopyBufferToImage);
1470 INSTANCE_SCOPE_FUNCTION(vkCmdCopyImageToBuffer);
1471 INSTANCE_SCOPE_FUNCTION(vkCmdUpdateBuffer);
1472 INSTANCE_SCOPE_FUNCTION(vkCmdFillBuffer);
1473 INSTANCE_SCOPE_FUNCTION(vkCmdClearColorImage);
1474 INSTANCE_SCOPE_FUNCTION(vkCmdClearDepthStencilImage);
1475 INSTANCE_SCOPE_FUNCTION(vkCmdClearAttachments);
1476 INSTANCE_SCOPE_FUNCTION(vkCmdResolveImage);
1477 INSTANCE_SCOPE_FUNCTION(vkCmdSetEvent);
1478 INSTANCE_SCOPE_FUNCTION(vkCmdResetEvent);
1479 INSTANCE_SCOPE_FUNCTION(vkCmdWaitEvents);
1480 INSTANCE_SCOPE_FUNCTION(vkCmdPipelineBarrier);
1481 INSTANCE_SCOPE_FUNCTION(vkCmdBeginQuery);
1482 INSTANCE_SCOPE_FUNCTION(vkCmdEndQuery);
1483 INSTANCE_SCOPE_FUNCTION(vkCmdResetQueryPool);
1484 INSTANCE_SCOPE_FUNCTION(vkCmdWriteTimestamp);
1485 INSTANCE_SCOPE_FUNCTION(vkCmdCopyQueryPoolResults);
1486 INSTANCE_SCOPE_FUNCTION(vkCmdPushConstants);
1487 INSTANCE_SCOPE_FUNCTION(vkCmdBeginRenderPass);
1488 INSTANCE_SCOPE_FUNCTION(vkCmdNextSubpass);
1489 INSTANCE_SCOPE_FUNCTION(vkCmdEndRenderPass);
1490 INSTANCE_SCOPE_FUNCTION(vkCmdExecuteCommands);
1491
1492 #undef LIBRARY_SCOPE_FUNCTION
1493 #undef INSTANCE_SCOPE_FUNCTION
1494 return nullptr;
1495 }
1496
1497 PFN_vkVoidFunction Vulkan_loader_interface::get_instance_proc_addr(VkInstance instance,
1498 const char *name) noexcept
1499 {
1500 if(!instance)
1501 return get_procedure_address(name, Procedure_address_scope::Library);
1502 return get_procedure_address(name, Procedure_address_scope::Instance);
1503 }
1504
1505 VkResult Vulkan_loader_interface::create_instance(const VkInstanceCreateInfo *create_info,
1506 const VkAllocationCallbacks *allocator,
1507 VkInstance *instance) noexcept
1508 {
1509 validate_allocator(allocator);
1510 assert(create_info);
1511 assert(instance);
1512 return catch_exceptions_and_return_result(
1513 [&]()
1514 {
1515 auto create_result = vulkan::Vulkan_instance::create(*create_info);
1516 if(util::holds_alternative<VkResult>(create_result))
1517 return util::get<VkResult>(create_result);
1518 *instance = move_to_handle(
1519 util::get<std::unique_ptr<vulkan::Vulkan_instance>>(std::move(create_result)));
1520 return VK_SUCCESS;
1521 });
1522 }
1523
1524 VkResult Vulkan_loader_interface::enumerate_instance_extension_properties(
1525 const char *layer_name, uint32_t *property_count, VkExtensionProperties *properties) noexcept
1526 {
1527 assert(layer_name == nullptr);
1528 static constexpr std::initializer_list<VkExtensionProperties> extensions = {};
1529 return vulkan_enumerate_list_helper(property_count, properties, extensions);
1530 }
1531
1532 VkResult Vulkan_loader_interface::enumerate_device_extension_properties(
1533 VkPhysicalDevice physical_device,
1534 const char *layer_name,
1535 uint32_t *property_count,
1536 VkExtensionProperties *properties) noexcept
1537 {
1538 assert(layer_name == nullptr);
1539 assert(physical_device != nullptr);
1540 static constexpr std::initializer_list<VkExtensionProperties> extensions = {};
1541 return vulkan_enumerate_list_helper(property_count, properties, extensions);
1542 }
1543 }
1544
1545 void vulkan_icd::print_exception(std::exception &e) noexcept
1546 {
1547 std::cerr << "error: " << e.what() << std::endl;
1548 }
1549 }