Browse Source

Vk: initial Vulkan headers generated using flextGL.

pull/194/merge
Vladimír Vondruš 8 years ago
parent
commit
b1377033e8
  1. 16
      doc/developers.dox
  2. 45
      src/Magnum/Vk/CMakeLists.txt
  3. 25
      src/Magnum/Vk/Test/CMakeLists.txt
  4. 38
      src/Magnum/Vk/Vk.h
  5. 50
      src/Magnum/Vk/visibility.h
  6. 3
      src/MagnumExternal/CMakeLists.txt
  7. 36
      src/MagnumExternal/Vulkan/CMakeLists.txt
  8. 25
      src/MagnumExternal/Vulkan/extensions.txt
  9. 229
      src/MagnumExternal/Vulkan/flextVk.cpp
  10. 56
      src/MagnumExternal/Vulkan/flextVk.cpp.template
  11. 3577
      src/MagnumExternal/Vulkan/flextVk.h
  12. 157
      src/MagnumExternal/Vulkan/flextVk.h.template
  13. 324
      src/MagnumExternal/Vulkan/flextVkGlobal.h
  14. 73
      src/MagnumExternal/Vulkan/flextVkGlobal.h.template

16
doc/developers.dox

@ -607,6 +607,22 @@ In order to remove OpenAL functionality, be sure to touch all places mentioned
above, only in inverse --- but usually @ref developers-deprecation "deprecate first",
unless it doesn't affect public API at all.
@section developers-vk-extensions Checklist for adding / removing Vulkan versions and extensions
@todoc adapt from the GL section
In order to remove Vulkan functionality, be sure to touch all places mentioned
above, only in inverse --- but usually @ref developers-deprecation "deprecate first",
unless it doesn't affect public API at all.
@section developers-vk-functionality Checklist for adding / removing Vulkan functionality
@todoc adapt from the GL section
In order to remove Vulkan functionality, be sure to touch all places mentioned
above, only in inverse --- but usually @ref developers-deprecation "deprecate first",
unless it doesn't affect public API at all.
@section developers-dependency Checklist for adding, removing or updating a dependency
1. Verify that there are no important clients stuck on the old version with no

45
src/Magnum/Vk/CMakeLists.txt

@ -24,3 +24,48 @@
# DEALINGS IN THE SOFTWARE.
#
# We don't need system-wide includes
set(Vulkan_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/src/MagnumExternal/Vulkan)
find_package(Vulkan REQUIRED)
set(MagnumVk_SRCS )
set(MagnumVk_HEADERS
Vk.h
visibility.h)
set(MagnumVk_PRIVATE_HEADERS )
# Vk library
add_library(MagnumVk ${SHARED_OR_STATIC}
${MagnumVk_SRCS}
${MagnumVk_HEADERS}
${MagnumVk_PRIVATE_HEADERS}
$<TARGET_OBJECTS:MagnumFlextVkObjects>)
set_target_properties(MagnumVk PROPERTIES
DEBUG_POSTFIX "-d"
FOLDER "Magnum/Vk")
if(NOT BUILD_STATIC)
target_compile_definitions(MagnumVk PRIVATE "FlextVk_EXPORTS")
set_target_properties(MagnumVk PROPERTIES VERSION ${MAGNUM_LIBRARY_VERSION} SOVERSION ${MAGNUM_LIBRARY_SOVERSION})
elseif(BUILD_STATIC_PIC)
set_target_properties(MagnumVk PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()
target_include_directories(MagnumVk PUBLIC
${PROJECT_SOURCE_DIR}/src
${PROJECT_BINARY_DIR}/src)
target_link_libraries(MagnumVk PUBLIC
Magnum
Vulkan::Vulkan)
install(TARGETS MagnumVk
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}
ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
install(FILES ${MagnumVk_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Vk)
# Magnum Vk library target alias for superprojects
add_library(Magnum::Vk ALIAS MagnumVk)
if(BUILD_TESTS)
add_subdirectory(Test)
endif()

25
src/Magnum/Vk/Test/CMakeLists.txt

@ -0,0 +1,25 @@
#
# This file is part of Magnum.
#
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
# Vladimír Vondruš <mosra@centrum.cz>
# Copyright © 2016 Jonathan Hale <squareys@googlemail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#

38
src/Magnum/Vk/Vk.h

@ -0,0 +1,38 @@
#ifndef Magnum_Vk_Vk_h
#define Magnum_Vk_Vk_h
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
Vladimír Vondruš <mosra@centrum.cz>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
/** @file
* @brief Forward declarations for the @ref Magnum::Vk namespace
*/
namespace Magnum { namespace Vk {
}}
#endif

50
src/Magnum/Vk/visibility.h

@ -0,0 +1,50 @@
#ifndef Magnum_Vk_visibility_h
#define Magnum_Vk_visibility_h
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
Vladimír Vondruš <mosra@centrum.cz>
Copyright © 2016 Jonathan Hale <squareys@googlemail.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#include <Corrade/Utility/VisibilityMacros.h>
#include "Magnum/configure.h"
#ifndef DOXYGEN_GENERATING_OUTPUT
#ifndef MAGNUM_BUILD_STATIC
#ifdef MagnumVk_EXPORTS
#define MAGNUM_VK_EXPORT CORRADE_VISIBILITY_EXPORT
#else
#define MAGNUM_VK_EXPORT CORRADE_VISIBILITY_IMPORT
#endif
#else
#define MAGNUM_VK_EXPORT CORRADE_VISIBILITY_STATIC
#endif
#define MAGNUM_VK_LOCAL CORRADE_VISIBILITY_LOCAL
#else
#define MAGNUM_VK_EXPORT
#define MAGNUM_VK_LOCAL
#endif
#endif

3
src/MagnumExternal/CMakeLists.txt vendored

@ -29,6 +29,9 @@ endif()
if(WITH_GL)
add_subdirectory(OpenGL)
endif()
if(WITH_VK)
add_subdirectory(Vulkan)
endif()
if(MAGNUM_BUILD_DEPRECATED)
add_subdirectory(Optional)

36
src/MagnumExternal/Vulkan/CMakeLists.txt vendored

@ -0,0 +1,36 @@
#
# This file is part of Magnum.
#
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
# Vladimír Vondruš <mosra@centrum.cz>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
add_library(MagnumFlextVkObjects OBJECT flextVk.cpp)
target_include_directories(MagnumFlextVkObjects PUBLIC $<TARGET_PROPERTY:MagnumVk,INTERFACE_INCLUDE_DIRECTORIES>)
if(NOT BUILD_STATIC)
target_compile_definitions(MagnumFlextVkObjects PRIVATE "FlextVk_EXPORTS")
endif()
if(NOT BUILD_STATIC OR BUILD_STATIC_PIC)
set_target_properties(MagnumFlextVkObjects PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()
set_target_properties(MagnumFlextVkObjects PROPERTIES FOLDER "MagnumExternal/Vulkan")
install(FILES flextVk.h flextVkGlobal.h DESTINATION ${MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR}/Vulkan)

25
src/MagnumExternal/Vulkan/extensions.txt vendored

@ -0,0 +1,25 @@
version 1.1 vulkan
extension KHR_16bit_storage optional
extension KHR_bind_memory2 optional
extension KHR_dedicated_allocation optional
extension KHR_descriptor_update_template optional
extension KHR_device_group optional
extension KHR_device_group_creation optional
extension KHR_external_memory optional
extension KHR_external_memory_capabilities optional
extension KHR_external_semaphore optional
extension KHR_external_semaphore_capabilities optional
extension KHR_external_fence optional
extension KHR_external_fence_capabilities optional
extension KHR_get_memory_requirements2 optional
extension KHR_get_physical_device_properties2 optional
extension KHR_maintenance1 optional
extension KHR_maintenance2 optional
extension KHR_maintenance3 optional
extension KHR_multiview optional
extension KHR_relaxed_block_layout optional
extension KHR_sampler_ycbcr_conversion optional
extension KHR_shader_draw_parameters optional
extension KHR_storage_buffer_storage_class optional
extension KHR_variable_pointers optional

229
src/MagnumExternal/Vulkan/flextVk.cpp vendored

@ -0,0 +1,229 @@
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
Vladimír Vondruš <mosra@centrum.cz>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#include "flextVk.h"
#include "flextVkGlobal.h"
FlextVkInstance flextVkInstance{};
FlextVkDevice flextVkDevice{};
void flextVkInitInstance(VkInstance instance, FlextVkInstance* data) {
data->GetPhysicalDevicePresentRectanglesKHR = reinterpret_cast<VkResult(VKAPI_PTR*)(VkPhysicalDevice, VkSurfaceKHR, uint32_t*, VkRect2D*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDevicePresentRectanglesKHR"));
data->EnumeratePhysicalDeviceGroupsKHR = reinterpret_cast<VkResult(VKAPI_PTR*)(VkInstance, uint32_t*, VkPhysicalDeviceGroupProperties*)>(vkGetInstanceProcAddr(instance, "vkEnumeratePhysicalDeviceGroupsKHR"));
data->GetPhysicalDeviceExternalFencePropertiesKHR = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, const VkPhysicalDeviceExternalFenceInfo*, VkExternalFenceProperties*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceExternalFencePropertiesKHR"));
data->GetPhysicalDeviceExternalBufferPropertiesKHR = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, const VkPhysicalDeviceExternalBufferInfo*, VkExternalBufferProperties*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceExternalBufferPropertiesKHR"));
data->GetPhysicalDeviceExternalSemaphorePropertiesKHR = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo*, VkExternalSemaphoreProperties*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR"));
data->GetPhysicalDeviceFeatures2KHR = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, VkPhysicalDeviceFeatures2*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceFeatures2KHR"));
data->GetPhysicalDeviceFormatProperties2KHR = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, VkFormat, VkFormatProperties2*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceFormatProperties2KHR"));
data->GetPhysicalDeviceImageFormatProperties2KHR = reinterpret_cast<VkResult(VKAPI_PTR*)(VkPhysicalDevice, const VkPhysicalDeviceImageFormatInfo2*, VkImageFormatProperties2*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceImageFormatProperties2KHR"));
data->GetPhysicalDeviceMemoryProperties2KHR = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties2*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceMemoryProperties2KHR"));
data->GetPhysicalDeviceProperties2KHR = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, VkPhysicalDeviceProperties2*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceProperties2KHR"));
data->GetPhysicalDeviceQueueFamilyProperties2KHR = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, uint32_t*, VkQueueFamilyProperties2*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceQueueFamilyProperties2KHR"));
data->GetPhysicalDeviceSparseImageFormatProperties2KHR = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2*, uint32_t*, VkSparseImageFormatProperties2*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceSparseImageFormatProperties2KHR"));
data->CreateDevice = reinterpret_cast<VkResult(VKAPI_PTR*)(VkPhysicalDevice, const VkDeviceCreateInfo*, const VkAllocationCallbacks*, VkDevice*)>(vkGetInstanceProcAddr(instance, "vkCreateDevice"));
data->DestroyInstance = reinterpret_cast<void(VKAPI_PTR*)(VkInstance, const VkAllocationCallbacks*)>(vkGetInstanceProcAddr(instance, "vkDestroyInstance"));
data->EnumerateDeviceExtensionProperties = reinterpret_cast<VkResult(VKAPI_PTR*)(VkPhysicalDevice, const char*, uint32_t*, VkExtensionProperties*)>(vkGetInstanceProcAddr(instance, "vkEnumerateDeviceExtensionProperties"));
data->EnumerateDeviceLayerProperties = reinterpret_cast<VkResult(VKAPI_PTR*)(VkPhysicalDevice, uint32_t*, VkLayerProperties*)>(vkGetInstanceProcAddr(instance, "vkEnumerateDeviceLayerProperties"));
data->EnumeratePhysicalDevices = reinterpret_cast<VkResult(VKAPI_PTR*)(VkInstance, uint32_t*, VkPhysicalDevice*)>(vkGetInstanceProcAddr(instance, "vkEnumeratePhysicalDevices"));
data->GetDeviceProcAddr = reinterpret_cast<PFN_vkVoidFunction(VKAPI_PTR*)(VkDevice, const char*)>(vkGetInstanceProcAddr(instance, "vkGetDeviceProcAddr"));
data->GetPhysicalDeviceFeatures = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, VkPhysicalDeviceFeatures*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceFeatures"));
data->GetPhysicalDeviceFormatProperties = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, VkFormat, VkFormatProperties*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceFormatProperties"));
data->GetPhysicalDeviceImageFormatProperties = reinterpret_cast<VkResult(VKAPI_PTR*)(VkPhysicalDevice, VkFormat, VkImageType, VkImageTiling, VkImageUsageFlags, VkImageCreateFlags, VkImageFormatProperties*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceImageFormatProperties"));
data->GetPhysicalDeviceMemoryProperties = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceMemoryProperties"));
data->GetPhysicalDeviceProperties = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, VkPhysicalDeviceProperties*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceProperties"));
data->GetPhysicalDeviceQueueFamilyProperties = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, uint32_t*, VkQueueFamilyProperties*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceQueueFamilyProperties"));
data->GetPhysicalDeviceSparseImageFormatProperties = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, VkFormat, VkImageType, VkSampleCountFlagBits, VkImageUsageFlags, VkImageTiling, uint32_t*, VkSparseImageFormatProperties*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceSparseImageFormatProperties"));
data->EnumeratePhysicalDeviceGroups = reinterpret_cast<VkResult(VKAPI_PTR*)(VkInstance, uint32_t*, VkPhysicalDeviceGroupProperties*)>(vkGetInstanceProcAddr(instance, "vkEnumeratePhysicalDeviceGroups"));
data->GetPhysicalDeviceExternalBufferProperties = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, const VkPhysicalDeviceExternalBufferInfo*, VkExternalBufferProperties*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceExternalBufferProperties"));
data->GetPhysicalDeviceExternalFenceProperties = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, const VkPhysicalDeviceExternalFenceInfo*, VkExternalFenceProperties*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceExternalFenceProperties"));
data->GetPhysicalDeviceExternalSemaphoreProperties = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo*, VkExternalSemaphoreProperties*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceExternalSemaphoreProperties"));
data->GetPhysicalDeviceFeatures2 = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, VkPhysicalDeviceFeatures2*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceFeatures2"));
data->GetPhysicalDeviceFormatProperties2 = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, VkFormat, VkFormatProperties2*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceFormatProperties2"));
data->GetPhysicalDeviceImageFormatProperties2 = reinterpret_cast<VkResult(VKAPI_PTR*)(VkPhysicalDevice, const VkPhysicalDeviceImageFormatInfo2*, VkImageFormatProperties2*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceImageFormatProperties2"));
data->GetPhysicalDeviceMemoryProperties2 = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties2*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceMemoryProperties2"));
data->GetPhysicalDeviceProperties2 = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, VkPhysicalDeviceProperties2*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceProperties2"));
data->GetPhysicalDeviceQueueFamilyProperties2 = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, uint32_t*, VkQueueFamilyProperties2*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceQueueFamilyProperties2"));
data->GetPhysicalDeviceSparseImageFormatProperties2 = reinterpret_cast<void(VKAPI_PTR*)(VkPhysicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2*, uint32_t*, VkSparseImageFormatProperties2*)>(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceSparseImageFormatProperties2"));
}
void flextVkInitDevice(VkDevice device, FlextVkDevice* data, PFN_vkVoidFunction(VKAPI_PTR *getDeviceProcAddr)(VkDevice, const char*)) {
data->BindBufferMemory2KHR = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, uint32_t, const VkBindBufferMemoryInfo*)>(getDeviceProcAddr(device, "vkBindBufferMemory2KHR"));
data->BindImageMemory2KHR = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, uint32_t, const VkBindImageMemoryInfo*)>(getDeviceProcAddr(device, "vkBindImageMemory2KHR"));
data->CmdPushDescriptorSetWithTemplateKHR = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkDescriptorUpdateTemplate, VkPipelineLayout, uint32_t, const void*)>(getDeviceProcAddr(device, "vkCmdPushDescriptorSetWithTemplateKHR"));
data->CreateDescriptorUpdateTemplateKHR = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkDescriptorUpdateTemplateCreateInfo*, const VkAllocationCallbacks*, VkDescriptorUpdateTemplate*)>(getDeviceProcAddr(device, "vkCreateDescriptorUpdateTemplateKHR"));
data->DestroyDescriptorUpdateTemplateKHR = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkDescriptorUpdateTemplate, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyDescriptorUpdateTemplateKHR"));
data->UpdateDescriptorSetWithTemplateKHR = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkDescriptorSet, VkDescriptorUpdateTemplate, const void*)>(getDeviceProcAddr(device, "vkUpdateDescriptorSetWithTemplateKHR"));
data->AcquireNextImage2KHR = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkAcquireNextImageInfoKHR*, uint32_t*)>(getDeviceProcAddr(device, "vkAcquireNextImage2KHR"));
data->CmdDispatchBaseKHR = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)>(getDeviceProcAddr(device, "vkCmdDispatchBaseKHR"));
data->CmdSetDeviceMaskKHR = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, uint32_t)>(getDeviceProcAddr(device, "vkCmdSetDeviceMaskKHR"));
data->GetDeviceGroupPeerMemoryFeaturesKHR = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, uint32_t, uint32_t, uint32_t, VkPeerMemoryFeatureFlags*)>(getDeviceProcAddr(device, "vkGetDeviceGroupPeerMemoryFeaturesKHR"));
data->GetDeviceGroupPresentCapabilitiesKHR = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkDeviceGroupPresentCapabilitiesKHR*)>(getDeviceProcAddr(device, "vkGetDeviceGroupPresentCapabilitiesKHR"));
data->GetDeviceGroupSurfacePresentModesKHR = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkSurfaceKHR, VkDeviceGroupPresentModeFlagsKHR*)>(getDeviceProcAddr(device, "vkGetDeviceGroupSurfacePresentModesKHR"));
data->GetBufferMemoryRequirements2KHR = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, const VkBufferMemoryRequirementsInfo2*, VkMemoryRequirements2*)>(getDeviceProcAddr(device, "vkGetBufferMemoryRequirements2KHR"));
data->GetImageMemoryRequirements2KHR = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, const VkImageMemoryRequirementsInfo2*, VkMemoryRequirements2*)>(getDeviceProcAddr(device, "vkGetImageMemoryRequirements2KHR"));
data->GetImageSparseMemoryRequirements2KHR = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, const VkImageSparseMemoryRequirementsInfo2*, uint32_t*, VkSparseImageMemoryRequirements2*)>(getDeviceProcAddr(device, "vkGetImageSparseMemoryRequirements2KHR"));
data->TrimCommandPoolKHR = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkCommandPool, VkCommandPoolTrimFlags)>(getDeviceProcAddr(device, "vkTrimCommandPoolKHR"));
data->GetDescriptorSetLayoutSupportKHR = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, const VkDescriptorSetLayoutCreateInfo*, VkDescriptorSetLayoutSupport*)>(getDeviceProcAddr(device, "vkGetDescriptorSetLayoutSupportKHR"));
data->CreateSamplerYcbcrConversionKHR = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkSamplerYcbcrConversionCreateInfo*, const VkAllocationCallbacks*, VkSamplerYcbcrConversion*)>(getDeviceProcAddr(device, "vkCreateSamplerYcbcrConversionKHR"));
data->DestroySamplerYcbcrConversionKHR = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkSamplerYcbcrConversion, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroySamplerYcbcrConversionKHR"));
data->AllocateCommandBuffers = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkCommandBufferAllocateInfo*, VkCommandBuffer*)>(getDeviceProcAddr(device, "vkAllocateCommandBuffers"));
data->AllocateDescriptorSets = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkDescriptorSetAllocateInfo*, VkDescriptorSet*)>(getDeviceProcAddr(device, "vkAllocateDescriptorSets"));
data->AllocateMemory = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkMemoryAllocateInfo*, const VkAllocationCallbacks*, VkDeviceMemory*)>(getDeviceProcAddr(device, "vkAllocateMemory"));
data->BeginCommandBuffer = reinterpret_cast<VkResult(VKAPI_PTR*)(VkCommandBuffer, const VkCommandBufferBeginInfo*)>(getDeviceProcAddr(device, "vkBeginCommandBuffer"));
data->BindBufferMemory = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkBuffer, VkDeviceMemory, VkDeviceSize)>(getDeviceProcAddr(device, "vkBindBufferMemory"));
data->BindImageMemory = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkImage, VkDeviceMemory, VkDeviceSize)>(getDeviceProcAddr(device, "vkBindImageMemory"));
data->CmdBeginQuery = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkQueryPool, uint32_t, VkQueryControlFlags)>(getDeviceProcAddr(device, "vkCmdBeginQuery"));
data->CmdBeginRenderPass = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, const VkRenderPassBeginInfo*, VkSubpassContents)>(getDeviceProcAddr(device, "vkCmdBeginRenderPass"));
data->CmdBindDescriptorSets = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t, uint32_t, const VkDescriptorSet*, uint32_t, const uint32_t*)>(getDeviceProcAddr(device, "vkCmdBindDescriptorSets"));
data->CmdBindIndexBuffer = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkIndexType)>(getDeviceProcAddr(device, "vkCmdBindIndexBuffer"));
data->CmdBindPipeline = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkPipelineBindPoint, VkPipeline)>(getDeviceProcAddr(device, "vkCmdBindPipeline"));
data->CmdBindVertexBuffers = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, uint32_t, uint32_t, const VkBuffer*, const VkDeviceSize*)>(getDeviceProcAddr(device, "vkCmdBindVertexBuffers"));
data->CmdBlitImage = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkImage, VkImageLayout, VkImage, VkImageLayout, uint32_t, const VkImageBlit*, VkFilter)>(getDeviceProcAddr(device, "vkCmdBlitImage"));
data->CmdClearAttachments = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, uint32_t, const VkClearAttachment*, uint32_t, const VkClearRect*)>(getDeviceProcAddr(device, "vkCmdClearAttachments"));
data->CmdClearColorImage = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkImage, VkImageLayout, const VkClearColorValue*, uint32_t, const VkImageSubresourceRange*)>(getDeviceProcAddr(device, "vkCmdClearColorImage"));
data->CmdClearDepthStencilImage = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkImage, VkImageLayout, const VkClearDepthStencilValue*, uint32_t, const VkImageSubresourceRange*)>(getDeviceProcAddr(device, "vkCmdClearDepthStencilImage"));
data->CmdCopyBuffer = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkBuffer, VkBuffer, uint32_t, const VkBufferCopy*)>(getDeviceProcAddr(device, "vkCmdCopyBuffer"));
data->CmdCopyBufferToImage = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkBuffer, VkImage, VkImageLayout, uint32_t, const VkBufferImageCopy*)>(getDeviceProcAddr(device, "vkCmdCopyBufferToImage"));
data->CmdCopyImage = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkImage, VkImageLayout, VkImage, VkImageLayout, uint32_t, const VkImageCopy*)>(getDeviceProcAddr(device, "vkCmdCopyImage"));
data->CmdCopyImageToBuffer = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkImage, VkImageLayout, VkBuffer, uint32_t, const VkBufferImageCopy*)>(getDeviceProcAddr(device, "vkCmdCopyImageToBuffer"));
data->CmdCopyQueryPoolResults = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkQueryPool, uint32_t, uint32_t, VkBuffer, VkDeviceSize, VkDeviceSize, VkQueryResultFlags)>(getDeviceProcAddr(device, "vkCmdCopyQueryPoolResults"));
data->CmdDispatch = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, uint32_t, uint32_t, uint32_t)>(getDeviceProcAddr(device, "vkCmdDispatch"));
data->CmdDispatchIndirect = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkBuffer, VkDeviceSize)>(getDeviceProcAddr(device, "vkCmdDispatchIndirect"));
data->CmdDraw = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, uint32_t)>(getDeviceProcAddr(device, "vkCmdDraw"));
data->CmdDrawIndexed = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, int32_t, uint32_t)>(getDeviceProcAddr(device, "vkCmdDrawIndexed"));
data->CmdDrawIndexedIndirect = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t)>(getDeviceProcAddr(device, "vkCmdDrawIndexedIndirect"));
data->CmdDrawIndirect = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t)>(getDeviceProcAddr(device, "vkCmdDrawIndirect"));
data->CmdEndQuery = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkQueryPool, uint32_t)>(getDeviceProcAddr(device, "vkCmdEndQuery"));
data->CmdEndRenderPass = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer)>(getDeviceProcAddr(device, "vkCmdEndRenderPass"));
data->CmdExecuteCommands = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, uint32_t, const VkCommandBuffer*)>(getDeviceProcAddr(device, "vkCmdExecuteCommands"));
data->CmdFillBuffer = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkDeviceSize, uint32_t)>(getDeviceProcAddr(device, "vkCmdFillBuffer"));
data->CmdNextSubpass = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkSubpassContents)>(getDeviceProcAddr(device, "vkCmdNextSubpass"));
data->CmdPipelineBarrier = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkPipelineStageFlags, VkPipelineStageFlags, VkDependencyFlags, uint32_t, const VkMemoryBarrier*, uint32_t, const VkBufferMemoryBarrier*, uint32_t, const VkImageMemoryBarrier*)>(getDeviceProcAddr(device, "vkCmdPipelineBarrier"));
data->CmdPushConstants = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkPipelineLayout, VkShaderStageFlags, uint32_t, uint32_t, const void*)>(getDeviceProcAddr(device, "vkCmdPushConstants"));
data->CmdResetEvent = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkEvent, VkPipelineStageFlags)>(getDeviceProcAddr(device, "vkCmdResetEvent"));
data->CmdResetQueryPool = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkQueryPool, uint32_t, uint32_t)>(getDeviceProcAddr(device, "vkCmdResetQueryPool"));
data->CmdResolveImage = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkImage, VkImageLayout, VkImage, VkImageLayout, uint32_t, const VkImageResolve*)>(getDeviceProcAddr(device, "vkCmdResolveImage"));
data->CmdSetBlendConstants = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, const float [4])>(getDeviceProcAddr(device, "vkCmdSetBlendConstants"));
data->CmdSetDepthBias = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, float, float, float)>(getDeviceProcAddr(device, "vkCmdSetDepthBias"));
data->CmdSetDepthBounds = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, float, float)>(getDeviceProcAddr(device, "vkCmdSetDepthBounds"));
data->CmdSetEvent = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkEvent, VkPipelineStageFlags)>(getDeviceProcAddr(device, "vkCmdSetEvent"));
data->CmdSetLineWidth = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, float)>(getDeviceProcAddr(device, "vkCmdSetLineWidth"));
data->CmdSetScissor = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, uint32_t, uint32_t, const VkRect2D*)>(getDeviceProcAddr(device, "vkCmdSetScissor"));
data->CmdSetStencilCompareMask = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkStencilFaceFlags, uint32_t)>(getDeviceProcAddr(device, "vkCmdSetStencilCompareMask"));
data->CmdSetStencilReference = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkStencilFaceFlags, uint32_t)>(getDeviceProcAddr(device, "vkCmdSetStencilReference"));
data->CmdSetStencilWriteMask = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkStencilFaceFlags, uint32_t)>(getDeviceProcAddr(device, "vkCmdSetStencilWriteMask"));
data->CmdSetViewport = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, uint32_t, uint32_t, const VkViewport*)>(getDeviceProcAddr(device, "vkCmdSetViewport"));
data->CmdUpdateBuffer = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkDeviceSize, const void*)>(getDeviceProcAddr(device, "vkCmdUpdateBuffer"));
data->CmdWaitEvents = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, uint32_t, const VkEvent*, VkPipelineStageFlags, VkPipelineStageFlags, uint32_t, const VkMemoryBarrier*, uint32_t, const VkBufferMemoryBarrier*, uint32_t, const VkImageMemoryBarrier*)>(getDeviceProcAddr(device, "vkCmdWaitEvents"));
data->CmdWriteTimestamp = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, VkPipelineStageFlagBits, VkQueryPool, uint32_t)>(getDeviceProcAddr(device, "vkCmdWriteTimestamp"));
data->CreateBuffer = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkBufferCreateInfo*, const VkAllocationCallbacks*, VkBuffer*)>(getDeviceProcAddr(device, "vkCreateBuffer"));
data->CreateBufferView = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkBufferViewCreateInfo*, const VkAllocationCallbacks*, VkBufferView*)>(getDeviceProcAddr(device, "vkCreateBufferView"));
data->CreateCommandPool = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkCommandPoolCreateInfo*, const VkAllocationCallbacks*, VkCommandPool*)>(getDeviceProcAddr(device, "vkCreateCommandPool"));
data->CreateComputePipelines = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkPipelineCache, uint32_t, const VkComputePipelineCreateInfo*, const VkAllocationCallbacks*, VkPipeline*)>(getDeviceProcAddr(device, "vkCreateComputePipelines"));
data->CreateDescriptorPool = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkDescriptorPoolCreateInfo*, const VkAllocationCallbacks*, VkDescriptorPool*)>(getDeviceProcAddr(device, "vkCreateDescriptorPool"));
data->CreateDescriptorSetLayout = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkDescriptorSetLayoutCreateInfo*, const VkAllocationCallbacks*, VkDescriptorSetLayout*)>(getDeviceProcAddr(device, "vkCreateDescriptorSetLayout"));
data->CreateEvent = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkEventCreateInfo*, const VkAllocationCallbacks*, VkEvent*)>(getDeviceProcAddr(device, "vkCreateEvent"));
data->CreateFence = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkFenceCreateInfo*, const VkAllocationCallbacks*, VkFence*)>(getDeviceProcAddr(device, "vkCreateFence"));
data->CreateFramebuffer = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkFramebufferCreateInfo*, const VkAllocationCallbacks*, VkFramebuffer*)>(getDeviceProcAddr(device, "vkCreateFramebuffer"));
data->CreateGraphicsPipelines = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkPipelineCache, uint32_t, const VkGraphicsPipelineCreateInfo*, const VkAllocationCallbacks*, VkPipeline*)>(getDeviceProcAddr(device, "vkCreateGraphicsPipelines"));
data->CreateImage = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkImageCreateInfo*, const VkAllocationCallbacks*, VkImage*)>(getDeviceProcAddr(device, "vkCreateImage"));
data->CreateImageView = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkImageViewCreateInfo*, const VkAllocationCallbacks*, VkImageView*)>(getDeviceProcAddr(device, "vkCreateImageView"));
data->CreatePipelineCache = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkPipelineCacheCreateInfo*, const VkAllocationCallbacks*, VkPipelineCache*)>(getDeviceProcAddr(device, "vkCreatePipelineCache"));
data->CreatePipelineLayout = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkPipelineLayoutCreateInfo*, const VkAllocationCallbacks*, VkPipelineLayout*)>(getDeviceProcAddr(device, "vkCreatePipelineLayout"));
data->CreateQueryPool = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkQueryPoolCreateInfo*, const VkAllocationCallbacks*, VkQueryPool*)>(getDeviceProcAddr(device, "vkCreateQueryPool"));
data->CreateRenderPass = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkRenderPassCreateInfo*, const VkAllocationCallbacks*, VkRenderPass*)>(getDeviceProcAddr(device, "vkCreateRenderPass"));
data->CreateSampler = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkSamplerCreateInfo*, const VkAllocationCallbacks*, VkSampler*)>(getDeviceProcAddr(device, "vkCreateSampler"));
data->CreateSemaphore = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkSemaphoreCreateInfo*, const VkAllocationCallbacks*, VkSemaphore*)>(getDeviceProcAddr(device, "vkCreateSemaphore"));
data->CreateShaderModule = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkShaderModuleCreateInfo*, const VkAllocationCallbacks*, VkShaderModule*)>(getDeviceProcAddr(device, "vkCreateShaderModule"));
data->DestroyBuffer = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkBuffer, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyBuffer"));
data->DestroyBufferView = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkBufferView, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyBufferView"));
data->DestroyCommandPool = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkCommandPool, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyCommandPool"));
data->DestroyDescriptorPool = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkDescriptorPool, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyDescriptorPool"));
data->DestroyDescriptorSetLayout = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkDescriptorSetLayout, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyDescriptorSetLayout"));
data->DestroyDevice = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyDevice"));
data->DestroyEvent = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkEvent, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyEvent"));
data->DestroyFence = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkFence, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyFence"));
data->DestroyFramebuffer = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkFramebuffer, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyFramebuffer"));
data->DestroyImage = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkImage, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyImage"));
data->DestroyImageView = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkImageView, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyImageView"));
data->DestroyPipeline = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkPipeline, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyPipeline"));
data->DestroyPipelineCache = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkPipelineCache, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyPipelineCache"));
data->DestroyPipelineLayout = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkPipelineLayout, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyPipelineLayout"));
data->DestroyQueryPool = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkQueryPool, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyQueryPool"));
data->DestroyRenderPass = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkRenderPass, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyRenderPass"));
data->DestroySampler = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkSampler, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroySampler"));
data->DestroySemaphore = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkSemaphore, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroySemaphore"));
data->DestroyShaderModule = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkShaderModule, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyShaderModule"));
data->DeviceWaitIdle = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice)>(getDeviceProcAddr(device, "vkDeviceWaitIdle"));
data->EndCommandBuffer = reinterpret_cast<VkResult(VKAPI_PTR*)(VkCommandBuffer)>(getDeviceProcAddr(device, "vkEndCommandBuffer"));
data->FlushMappedMemoryRanges = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, uint32_t, const VkMappedMemoryRange*)>(getDeviceProcAddr(device, "vkFlushMappedMemoryRanges"));
data->FreeCommandBuffers = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkCommandPool, uint32_t, const VkCommandBuffer*)>(getDeviceProcAddr(device, "vkFreeCommandBuffers"));
data->FreeDescriptorSets = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkDescriptorPool, uint32_t, const VkDescriptorSet*)>(getDeviceProcAddr(device, "vkFreeDescriptorSets"));
data->FreeMemory = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkDeviceMemory, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkFreeMemory"));
data->GetBufferMemoryRequirements = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkBuffer, VkMemoryRequirements*)>(getDeviceProcAddr(device, "vkGetBufferMemoryRequirements"));
data->GetDeviceMemoryCommitment = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkDeviceMemory, VkDeviceSize*)>(getDeviceProcAddr(device, "vkGetDeviceMemoryCommitment"));
data->GetDeviceQueue = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, uint32_t, uint32_t, VkQueue*)>(getDeviceProcAddr(device, "vkGetDeviceQueue"));
data->GetEventStatus = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkEvent)>(getDeviceProcAddr(device, "vkGetEventStatus"));
data->GetFenceStatus = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkFence)>(getDeviceProcAddr(device, "vkGetFenceStatus"));
data->GetImageMemoryRequirements = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkImage, VkMemoryRequirements*)>(getDeviceProcAddr(device, "vkGetImageMemoryRequirements"));
data->GetImageSparseMemoryRequirements = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkImage, uint32_t*, VkSparseImageMemoryRequirements*)>(getDeviceProcAddr(device, "vkGetImageSparseMemoryRequirements"));
data->GetImageSubresourceLayout = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkImage, const VkImageSubresource*, VkSubresourceLayout*)>(getDeviceProcAddr(device, "vkGetImageSubresourceLayout"));
data->GetPipelineCacheData = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkPipelineCache, size_t*, void*)>(getDeviceProcAddr(device, "vkGetPipelineCacheData"));
data->GetQueryPoolResults = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkQueryPool, uint32_t, uint32_t, size_t, void*, VkDeviceSize, VkQueryResultFlags)>(getDeviceProcAddr(device, "vkGetQueryPoolResults"));
data->GetRenderAreaGranularity = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkRenderPass, VkExtent2D*)>(getDeviceProcAddr(device, "vkGetRenderAreaGranularity"));
data->InvalidateMappedMemoryRanges = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, uint32_t, const VkMappedMemoryRange*)>(getDeviceProcAddr(device, "vkInvalidateMappedMemoryRanges"));
data->MapMemory = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkDeviceMemory, VkDeviceSize, VkDeviceSize, VkMemoryMapFlags, void**)>(getDeviceProcAddr(device, "vkMapMemory"));
data->MergePipelineCaches = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkPipelineCache, uint32_t, const VkPipelineCache*)>(getDeviceProcAddr(device, "vkMergePipelineCaches"));
data->QueueBindSparse = reinterpret_cast<VkResult(VKAPI_PTR*)(VkQueue, uint32_t, const VkBindSparseInfo*, VkFence)>(getDeviceProcAddr(device, "vkQueueBindSparse"));
data->QueueSubmit = reinterpret_cast<VkResult(VKAPI_PTR*)(VkQueue, uint32_t, const VkSubmitInfo*, VkFence)>(getDeviceProcAddr(device, "vkQueueSubmit"));
data->QueueWaitIdle = reinterpret_cast<VkResult(VKAPI_PTR*)(VkQueue)>(getDeviceProcAddr(device, "vkQueueWaitIdle"));
data->ResetCommandBuffer = reinterpret_cast<VkResult(VKAPI_PTR*)(VkCommandBuffer, VkCommandBufferResetFlags)>(getDeviceProcAddr(device, "vkResetCommandBuffer"));
data->ResetCommandPool = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkCommandPool, VkCommandPoolResetFlags)>(getDeviceProcAddr(device, "vkResetCommandPool"));
data->ResetDescriptorPool = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkDescriptorPool, VkDescriptorPoolResetFlags)>(getDeviceProcAddr(device, "vkResetDescriptorPool"));
data->ResetEvent = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkEvent)>(getDeviceProcAddr(device, "vkResetEvent"));
data->ResetFences = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, uint32_t, const VkFence*)>(getDeviceProcAddr(device, "vkResetFences"));
data->SetEvent = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, VkEvent)>(getDeviceProcAddr(device, "vkSetEvent"));
data->UnmapMemory = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkDeviceMemory)>(getDeviceProcAddr(device, "vkUnmapMemory"));
data->UpdateDescriptorSets = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, uint32_t, const VkWriteDescriptorSet*, uint32_t, const VkCopyDescriptorSet*)>(getDeviceProcAddr(device, "vkUpdateDescriptorSets"));
data->WaitForFences = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, uint32_t, const VkFence*, VkBool32, uint64_t)>(getDeviceProcAddr(device, "vkWaitForFences"));
data->BindBufferMemory2 = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, uint32_t, const VkBindBufferMemoryInfo*)>(getDeviceProcAddr(device, "vkBindBufferMemory2"));
data->BindImageMemory2 = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, uint32_t, const VkBindImageMemoryInfo*)>(getDeviceProcAddr(device, "vkBindImageMemory2"));
data->CmdDispatchBase = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)>(getDeviceProcAddr(device, "vkCmdDispatchBase"));
data->CmdSetDeviceMask = reinterpret_cast<void(VKAPI_PTR*)(VkCommandBuffer, uint32_t)>(getDeviceProcAddr(device, "vkCmdSetDeviceMask"));
data->CreateDescriptorUpdateTemplate = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkDescriptorUpdateTemplateCreateInfo*, const VkAllocationCallbacks*, VkDescriptorUpdateTemplate*)>(getDeviceProcAddr(device, "vkCreateDescriptorUpdateTemplate"));
data->CreateSamplerYcbcrConversion = reinterpret_cast<VkResult(VKAPI_PTR*)(VkDevice, const VkSamplerYcbcrConversionCreateInfo*, const VkAllocationCallbacks*, VkSamplerYcbcrConversion*)>(getDeviceProcAddr(device, "vkCreateSamplerYcbcrConversion"));
data->DestroyDescriptorUpdateTemplate = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkDescriptorUpdateTemplate, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroyDescriptorUpdateTemplate"));
data->DestroySamplerYcbcrConversion = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkSamplerYcbcrConversion, const VkAllocationCallbacks*)>(getDeviceProcAddr(device, "vkDestroySamplerYcbcrConversion"));
data->EnumerateInstanceVersion = reinterpret_cast<VkResult(VKAPI_PTR*)(uint32_t*)>(getDeviceProcAddr(device, "vkEnumerateInstanceVersion"));
data->GetBufferMemoryRequirements2 = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, const VkBufferMemoryRequirementsInfo2*, VkMemoryRequirements2*)>(getDeviceProcAddr(device, "vkGetBufferMemoryRequirements2"));
data->GetDescriptorSetLayoutSupport = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, const VkDescriptorSetLayoutCreateInfo*, VkDescriptorSetLayoutSupport*)>(getDeviceProcAddr(device, "vkGetDescriptorSetLayoutSupport"));
data->GetDeviceGroupPeerMemoryFeatures = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, uint32_t, uint32_t, uint32_t, VkPeerMemoryFeatureFlags*)>(getDeviceProcAddr(device, "vkGetDeviceGroupPeerMemoryFeatures"));
data->GetDeviceQueue2 = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, const VkDeviceQueueInfo2*, VkQueue*)>(getDeviceProcAddr(device, "vkGetDeviceQueue2"));
data->GetImageMemoryRequirements2 = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, const VkImageMemoryRequirementsInfo2*, VkMemoryRequirements2*)>(getDeviceProcAddr(device, "vkGetImageMemoryRequirements2"));
data->GetImageSparseMemoryRequirements2 = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, const VkImageSparseMemoryRequirementsInfo2*, uint32_t*, VkSparseImageMemoryRequirements2*)>(getDeviceProcAddr(device, "vkGetImageSparseMemoryRequirements2"));
data->TrimCommandPool = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkCommandPool, VkCommandPoolTrimFlags)>(getDeviceProcAddr(device, "vkTrimCommandPool"));
data->UpdateDescriptorSetWithTemplate = reinterpret_cast<void(VKAPI_PTR*)(VkDevice, VkDescriptorSet, VkDescriptorUpdateTemplate, const void*)>(getDeviceProcAddr(device, "vkUpdateDescriptorSetWithTemplate"));
}

56
src/MagnumExternal/Vulkan/flextVk.cpp.template vendored

@ -0,0 +1,56 @@
@require(passthru, functions, enums, options, version, extensions)
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
Vladimír Vondruš <mosra@@centrum.cz>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#include "flextVk.h"
#include "flextVkGlobal.h"
FlextVkInstance flextVkInstance{};
FlextVkDevice flextVkDevice{};
void flextVkInitInstance(VkInstance instance, FlextVkInstance* data) {
@for category,funcs in functions:
@if funcs:
@for f in funcs:
@if (f.params[0][1] in ['VkInstance', 'VkPhysicalDevice'] or f.name == 'GetDeviceProcAddr') and f.name != 'GetInstanceProcAddr':
data->@f.name = reinterpret_cast<@f.returntype\
(VKAPI_PTR*)(@f.param_type_list_string())>(vkGetInstanceProcAddr(instance, "vk@f.name"));
@end
@end
@end
@end
}
void flextVkInitDevice(VkDevice device, FlextVkDevice* data, PFN_vkVoidFunction(VKAPI_PTR *getDeviceProcAddr)(VkDevice, const char*)) {
@for category,funcs in functions:
@for f in funcs:
@if f.params[0][1] not in ['VkInstance', 'VkPhysicalDevice'] and f.name not in ['GetInstanceProcAddr', 'GetDeviceProcAddr', 'EnumerateInstanceExtensionProperties', 'EnumerateInstanceLayerProperties', 'CreateInstance']:
data->@f.name = reinterpret_cast<@f.returntype\
(VKAPI_PTR*)(@f.param_type_list_string())>(getDeviceProcAddr(device, "vk@f.name"));
@end
@end
@end
}

3577
src/MagnumExternal/Vulkan/flextVk.h vendored

File diff suppressed because it is too large Load Diff

157
src/MagnumExternal/Vulkan/flextVk.h.template vendored

@ -0,0 +1,157 @@
@require(passthru, functions, enums, options, version, extensions)
#ifndef _flextvk_h_
#define _flextvk_h_
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
Vladimír Vondruš <mosra@@centrum.cz>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#include <cstdint>
#include <Corrade/Utility/VisibilityMacros.h>
#include "Magnum/configure.h"
/* Defensive include guards */
#if defined(VULKAN_H_)
#error Attempt to include auto-generated header after including vulkan.h
#endif
#if defined(VK_PLATFORM_H_)
#error Attempt to include auto-generated header after including vk_platform.h
#endif
#define VULKAN_H_
#define VK_PLATFORM_H_
#ifdef __cplusplus
extern "C" {
#endif
#ifndef DOXYGEN_GENERATING_OUTPUT /* So the macro names are preserved in the docs */
/* Function declaration macros */
#ifndef MAGNUM_BUILD_STATIC
#ifdef FlextVk_EXPORTS
#define FLEXTVK_EXPORT CORRADE_VISIBILITY_EXPORT
#else
#define FLEXTVK_EXPORT CORRADE_VISIBILITY_IMPORT
#endif
#else
#define FLEXTVK_EXPORT CORRADE_VISIBILITY_STATIC
#endif
/* Verbatim copied from upstream vk_platform.h */
#if defined(_WIN32)
// On Windows, Vulkan commands use the stdcall convention
#define VKAPI_ATTR
#define VKAPI_CALL __stdcall
#define VKAPI_PTR VKAPI_CALL
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
#error "Vulkan isn't supported for the 'armeabi' NDK ABI"
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"
// calling convention, i.e. float parameters are passed in registers. This
// is true even if the rest of the application passes floats on the stack,
// as it does by default when compiling for the armeabi-v7a NDK ABI.
#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
#define VKAPI_CALL
#define VKAPI_PTR VKAPI_ATTR
#else
// On other platforms, use the default calling convention
#define VKAPI_ATTR
#define VKAPI_CALL
#define VKAPI_PTR
#endif
/* Enums */
@enums
/* Data types */
typedef std::size_t size_t;
@passthru
/* I'll bite the bullet and expect that vkCreateInstance(),
vkEnumerateInstanceExtensionProperties() and vkEnumerateInstanceLayerProperties()
functions can be loaded statically to avoid the need for a global
flextVkInit() that needs to be called before everything else */
@for cat,funcs in functions:
@for f in funcs:
@if f.name in ['GetInstanceProcAddr', 'EnumerateInstanceExtensionProperties', 'EnumerateInstanceLayerProperties', 'CreateInstance']:
VKAPI_ATTR @f.returntype VKAPI_CALL vk@f.name\
(@f.param_type_list_string());
@end
@end
@end
/* Per-instance function pointers */
struct FlextVkInstance {
@for cat,funcs in functions:
@if funcs:
/* VK_@cat */
@for f in funcs:
@if (f.params[0][1] in ['VkInstance', 'VkPhysicalDevice'] or f.name == 'GetDeviceProcAddr') and f.name != 'GetInstanceProcAddr':
@f.returntype\
(VKAPI_PTR *@f.name)(@f.param_type_list_string());
@end
@end
@end
@end
};
/* Per-instance function pointer initialization */
void FLEXTVK_EXPORT flextVkInitInstance(VkInstance instance, FlextVkInstance* data);
/* Per-device function pointers */
struct FlextVkDevice {
@for cat,funcs in functions:
@if funcs:
/* VK_@cat */
@for f in funcs:
@if f.params[0][1] not in ['VkInstance', 'VkPhysicalDevice'] and f.name not in ['GetInstanceProcAddr', 'GetDeviceProcAddr', 'EnumerateInstanceExtensionProperties', 'EnumerateInstanceLayerProperties', 'CreateInstance']:
@f.returntype\
(VKAPI_PTR *@f.name)(@f.param_type_list_string());
@end
@end
@end
@end
};
/* Per-device function pointer initialization */
void FLEXTVK_EXPORT flextVkInitDevice(VkDevice device, FlextVkDevice* data, PFN_vkVoidFunction(VKAPI_PTR *getDeviceProcAddr)(VkDevice, const char*));
#endif
#ifdef __cplusplus
}
#endif
#endif

324
src/MagnumExternal/Vulkan/flextVkGlobal.h vendored

@ -0,0 +1,324 @@
#ifndef _flextVkGlobal_h_
#define _flextVkGlobal_h_
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
Vladimír Vondruš <mosra@centrum.cz>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#include "MagnumExternal/Vulkan/flextVk.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef DOXYGEN_GENERATING_OUTPUT /* So the macro names are preserved in the docs */
/* Per-instance function pointers */
extern FLEXTVK_EXPORT FlextVkInstance flextVkInstance;
/* VK_KHR_bind_memory2 */
/* VK_KHR_descriptor_update_template */
/* VK_KHR_device_group */
#define vkGetPhysicalDevicePresentRectanglesKHR flextVkInstance.GetPhysicalDevicePresentRectanglesKHR
/* VK_KHR_device_group_creation */
#define vkEnumeratePhysicalDeviceGroupsKHR flextVkInstance.EnumeratePhysicalDeviceGroupsKHR
/* VK_KHR_external_fence_capabilities */
#define vkGetPhysicalDeviceExternalFencePropertiesKHR flextVkInstance.GetPhysicalDeviceExternalFencePropertiesKHR
/* VK_KHR_external_memory_capabilities */
#define vkGetPhysicalDeviceExternalBufferPropertiesKHR flextVkInstance.GetPhysicalDeviceExternalBufferPropertiesKHR
/* VK_KHR_external_semaphore_capabilities */
#define vkGetPhysicalDeviceExternalSemaphorePropertiesKHR flextVkInstance.GetPhysicalDeviceExternalSemaphorePropertiesKHR
/* VK_KHR_get_memory_requirements2 */
/* VK_KHR_get_physical_device_properties2 */
#define vkGetPhysicalDeviceFeatures2KHR flextVkInstance.GetPhysicalDeviceFeatures2KHR
#define vkGetPhysicalDeviceFormatProperties2KHR flextVkInstance.GetPhysicalDeviceFormatProperties2KHR
#define vkGetPhysicalDeviceImageFormatProperties2KHR flextVkInstance.GetPhysicalDeviceImageFormatProperties2KHR
#define vkGetPhysicalDeviceMemoryProperties2KHR flextVkInstance.GetPhysicalDeviceMemoryProperties2KHR
#define vkGetPhysicalDeviceProperties2KHR flextVkInstance.GetPhysicalDeviceProperties2KHR
#define vkGetPhysicalDeviceQueueFamilyProperties2KHR flextVkInstance.GetPhysicalDeviceQueueFamilyProperties2KHR
#define vkGetPhysicalDeviceSparseImageFormatProperties2KHR flextVkInstance.GetPhysicalDeviceSparseImageFormatProperties2KHR
/* VK_KHR_maintenance1 */
/* VK_KHR_maintenance3 */
/* VK_KHR_sampler_ycbcr_conversion */
/* VK_VERSION_1_0 */
#define vkCreateDevice flextVkInstance.CreateDevice
#define vkDestroyInstance flextVkInstance.DestroyInstance
#define vkEnumerateDeviceExtensionProperties flextVkInstance.EnumerateDeviceExtensionProperties
#define vkEnumerateDeviceLayerProperties flextVkInstance.EnumerateDeviceLayerProperties
#define vkEnumeratePhysicalDevices flextVkInstance.EnumeratePhysicalDevices
#define vkGetDeviceProcAddr flextVkInstance.GetDeviceProcAddr
#define vkGetPhysicalDeviceFeatures flextVkInstance.GetPhysicalDeviceFeatures
#define vkGetPhysicalDeviceFormatProperties flextVkInstance.GetPhysicalDeviceFormatProperties
#define vkGetPhysicalDeviceImageFormatProperties flextVkInstance.GetPhysicalDeviceImageFormatProperties
#define vkGetPhysicalDeviceMemoryProperties flextVkInstance.GetPhysicalDeviceMemoryProperties
#define vkGetPhysicalDeviceProperties flextVkInstance.GetPhysicalDeviceProperties
#define vkGetPhysicalDeviceQueueFamilyProperties flextVkInstance.GetPhysicalDeviceQueueFamilyProperties
#define vkGetPhysicalDeviceSparseImageFormatProperties flextVkInstance.GetPhysicalDeviceSparseImageFormatProperties
/* VK_VERSION_1_1 */
#define vkEnumeratePhysicalDeviceGroups flextVkInstance.EnumeratePhysicalDeviceGroups
#define vkGetPhysicalDeviceExternalBufferProperties flextVkInstance.GetPhysicalDeviceExternalBufferProperties
#define vkGetPhysicalDeviceExternalFenceProperties flextVkInstance.GetPhysicalDeviceExternalFenceProperties
#define vkGetPhysicalDeviceExternalSemaphoreProperties flextVkInstance.GetPhysicalDeviceExternalSemaphoreProperties
#define vkGetPhysicalDeviceFeatures2 flextVkInstance.GetPhysicalDeviceFeatures2
#define vkGetPhysicalDeviceFormatProperties2 flextVkInstance.GetPhysicalDeviceFormatProperties2
#define vkGetPhysicalDeviceImageFormatProperties2 flextVkInstance.GetPhysicalDeviceImageFormatProperties2
#define vkGetPhysicalDeviceMemoryProperties2 flextVkInstance.GetPhysicalDeviceMemoryProperties2
#define vkGetPhysicalDeviceProperties2 flextVkInstance.GetPhysicalDeviceProperties2
#define vkGetPhysicalDeviceQueueFamilyProperties2 flextVkInstance.GetPhysicalDeviceQueueFamilyProperties2
#define vkGetPhysicalDeviceSparseImageFormatProperties2 flextVkInstance.GetPhysicalDeviceSparseImageFormatProperties2
/* Per-device function pointers */
extern FLEXTVK_EXPORT FlextVkDevice flextVkDevice;
/* VK_KHR_bind_memory2 */
#define vkBindBufferMemory2KHR flextVkDevice.BindBufferMemory2KHR
#define vkBindImageMemory2KHR flextVkDevice.BindImageMemory2KHR
/* VK_KHR_descriptor_update_template */
#define vkCmdPushDescriptorSetWithTemplateKHR flextVkDevice.CmdPushDescriptorSetWithTemplateKHR
#define vkCreateDescriptorUpdateTemplateKHR flextVkDevice.CreateDescriptorUpdateTemplateKHR
#define vkDestroyDescriptorUpdateTemplateKHR flextVkDevice.DestroyDescriptorUpdateTemplateKHR
#define vkUpdateDescriptorSetWithTemplateKHR flextVkDevice.UpdateDescriptorSetWithTemplateKHR
/* VK_KHR_device_group */
#define vkAcquireNextImage2KHR flextVkDevice.AcquireNextImage2KHR
#define vkCmdDispatchBaseKHR flextVkDevice.CmdDispatchBaseKHR
#define vkCmdSetDeviceMaskKHR flextVkDevice.CmdSetDeviceMaskKHR
#define vkGetDeviceGroupPeerMemoryFeaturesKHR flextVkDevice.GetDeviceGroupPeerMemoryFeaturesKHR
#define vkGetDeviceGroupPresentCapabilitiesKHR flextVkDevice.GetDeviceGroupPresentCapabilitiesKHR
#define vkGetDeviceGroupSurfacePresentModesKHR flextVkDevice.GetDeviceGroupSurfacePresentModesKHR
/* VK_KHR_device_group_creation */
/* VK_KHR_external_fence_capabilities */
/* VK_KHR_external_memory_capabilities */
/* VK_KHR_external_semaphore_capabilities */
/* VK_KHR_get_memory_requirements2 */
#define vkGetBufferMemoryRequirements2KHR flextVkDevice.GetBufferMemoryRequirements2KHR
#define vkGetImageMemoryRequirements2KHR flextVkDevice.GetImageMemoryRequirements2KHR
#define vkGetImageSparseMemoryRequirements2KHR flextVkDevice.GetImageSparseMemoryRequirements2KHR
/* VK_KHR_get_physical_device_properties2 */
/* VK_KHR_maintenance1 */
#define vkTrimCommandPoolKHR flextVkDevice.TrimCommandPoolKHR
/* VK_KHR_maintenance3 */
#define vkGetDescriptorSetLayoutSupportKHR flextVkDevice.GetDescriptorSetLayoutSupportKHR
/* VK_KHR_sampler_ycbcr_conversion */
#define vkCreateSamplerYcbcrConversionKHR flextVkDevice.CreateSamplerYcbcrConversionKHR
#define vkDestroySamplerYcbcrConversionKHR flextVkDevice.DestroySamplerYcbcrConversionKHR
/* VK_VERSION_1_0 */
#define vkAllocateCommandBuffers flextVkDevice.AllocateCommandBuffers
#define vkAllocateDescriptorSets flextVkDevice.AllocateDescriptorSets
#define vkAllocateMemory flextVkDevice.AllocateMemory
#define vkBeginCommandBuffer flextVkDevice.BeginCommandBuffer
#define vkBindBufferMemory flextVkDevice.BindBufferMemory
#define vkBindImageMemory flextVkDevice.BindImageMemory
#define vkCmdBeginQuery flextVkDevice.CmdBeginQuery
#define vkCmdBeginRenderPass flextVkDevice.CmdBeginRenderPass
#define vkCmdBindDescriptorSets flextVkDevice.CmdBindDescriptorSets
#define vkCmdBindIndexBuffer flextVkDevice.CmdBindIndexBuffer
#define vkCmdBindPipeline flextVkDevice.CmdBindPipeline
#define vkCmdBindVertexBuffers flextVkDevice.CmdBindVertexBuffers
#define vkCmdBlitImage flextVkDevice.CmdBlitImage
#define vkCmdClearAttachments flextVkDevice.CmdClearAttachments
#define vkCmdClearColorImage flextVkDevice.CmdClearColorImage
#define vkCmdClearDepthStencilImage flextVkDevice.CmdClearDepthStencilImage
#define vkCmdCopyBuffer flextVkDevice.CmdCopyBuffer
#define vkCmdCopyBufferToImage flextVkDevice.CmdCopyBufferToImage
#define vkCmdCopyImage flextVkDevice.CmdCopyImage
#define vkCmdCopyImageToBuffer flextVkDevice.CmdCopyImageToBuffer
#define vkCmdCopyQueryPoolResults flextVkDevice.CmdCopyQueryPoolResults
#define vkCmdDispatch flextVkDevice.CmdDispatch
#define vkCmdDispatchIndirect flextVkDevice.CmdDispatchIndirect
#define vkCmdDraw flextVkDevice.CmdDraw
#define vkCmdDrawIndexed flextVkDevice.CmdDrawIndexed
#define vkCmdDrawIndexedIndirect flextVkDevice.CmdDrawIndexedIndirect
#define vkCmdDrawIndirect flextVkDevice.CmdDrawIndirect
#define vkCmdEndQuery flextVkDevice.CmdEndQuery
#define vkCmdEndRenderPass flextVkDevice.CmdEndRenderPass
#define vkCmdExecuteCommands flextVkDevice.CmdExecuteCommands
#define vkCmdFillBuffer flextVkDevice.CmdFillBuffer
#define vkCmdNextSubpass flextVkDevice.CmdNextSubpass
#define vkCmdPipelineBarrier flextVkDevice.CmdPipelineBarrier
#define vkCmdPushConstants flextVkDevice.CmdPushConstants
#define vkCmdResetEvent flextVkDevice.CmdResetEvent
#define vkCmdResetQueryPool flextVkDevice.CmdResetQueryPool
#define vkCmdResolveImage flextVkDevice.CmdResolveImage
#define vkCmdSetBlendConstants flextVkDevice.CmdSetBlendConstants
#define vkCmdSetDepthBias flextVkDevice.CmdSetDepthBias
#define vkCmdSetDepthBounds flextVkDevice.CmdSetDepthBounds
#define vkCmdSetEvent flextVkDevice.CmdSetEvent
#define vkCmdSetLineWidth flextVkDevice.CmdSetLineWidth
#define vkCmdSetScissor flextVkDevice.CmdSetScissor
#define vkCmdSetStencilCompareMask flextVkDevice.CmdSetStencilCompareMask
#define vkCmdSetStencilReference flextVkDevice.CmdSetStencilReference
#define vkCmdSetStencilWriteMask flextVkDevice.CmdSetStencilWriteMask
#define vkCmdSetViewport flextVkDevice.CmdSetViewport
#define vkCmdUpdateBuffer flextVkDevice.CmdUpdateBuffer
#define vkCmdWaitEvents flextVkDevice.CmdWaitEvents
#define vkCmdWriteTimestamp flextVkDevice.CmdWriteTimestamp
#define vkCreateBuffer flextVkDevice.CreateBuffer
#define vkCreateBufferView flextVkDevice.CreateBufferView
#define vkCreateCommandPool flextVkDevice.CreateCommandPool
#define vkCreateComputePipelines flextVkDevice.CreateComputePipelines
#define vkCreateDescriptorPool flextVkDevice.CreateDescriptorPool
#define vkCreateDescriptorSetLayout flextVkDevice.CreateDescriptorSetLayout
#define vkCreateEvent flextVkDevice.CreateEvent
#define vkCreateFence flextVkDevice.CreateFence
#define vkCreateFramebuffer flextVkDevice.CreateFramebuffer
#define vkCreateGraphicsPipelines flextVkDevice.CreateGraphicsPipelines
#define vkCreateImage flextVkDevice.CreateImage
#define vkCreateImageView flextVkDevice.CreateImageView
#define vkCreatePipelineCache flextVkDevice.CreatePipelineCache
#define vkCreatePipelineLayout flextVkDevice.CreatePipelineLayout
#define vkCreateQueryPool flextVkDevice.CreateQueryPool
#define vkCreateRenderPass flextVkDevice.CreateRenderPass
#define vkCreateSampler flextVkDevice.CreateSampler
#define vkCreateSemaphore flextVkDevice.CreateSemaphore
#define vkCreateShaderModule flextVkDevice.CreateShaderModule
#define vkDestroyBuffer flextVkDevice.DestroyBuffer
#define vkDestroyBufferView flextVkDevice.DestroyBufferView
#define vkDestroyCommandPool flextVkDevice.DestroyCommandPool
#define vkDestroyDescriptorPool flextVkDevice.DestroyDescriptorPool
#define vkDestroyDescriptorSetLayout flextVkDevice.DestroyDescriptorSetLayout
#define vkDestroyDevice flextVkDevice.DestroyDevice
#define vkDestroyEvent flextVkDevice.DestroyEvent
#define vkDestroyFence flextVkDevice.DestroyFence
#define vkDestroyFramebuffer flextVkDevice.DestroyFramebuffer
#define vkDestroyImage flextVkDevice.DestroyImage
#define vkDestroyImageView flextVkDevice.DestroyImageView
#define vkDestroyPipeline flextVkDevice.DestroyPipeline
#define vkDestroyPipelineCache flextVkDevice.DestroyPipelineCache
#define vkDestroyPipelineLayout flextVkDevice.DestroyPipelineLayout
#define vkDestroyQueryPool flextVkDevice.DestroyQueryPool
#define vkDestroyRenderPass flextVkDevice.DestroyRenderPass
#define vkDestroySampler flextVkDevice.DestroySampler
#define vkDestroySemaphore flextVkDevice.DestroySemaphore
#define vkDestroyShaderModule flextVkDevice.DestroyShaderModule
#define vkDeviceWaitIdle flextVkDevice.DeviceWaitIdle
#define vkEndCommandBuffer flextVkDevice.EndCommandBuffer
#define vkFlushMappedMemoryRanges flextVkDevice.FlushMappedMemoryRanges
#define vkFreeCommandBuffers flextVkDevice.FreeCommandBuffers
#define vkFreeDescriptorSets flextVkDevice.FreeDescriptorSets
#define vkFreeMemory flextVkDevice.FreeMemory
#define vkGetBufferMemoryRequirements flextVkDevice.GetBufferMemoryRequirements
#define vkGetDeviceMemoryCommitment flextVkDevice.GetDeviceMemoryCommitment
#define vkGetDeviceQueue flextVkDevice.GetDeviceQueue
#define vkGetEventStatus flextVkDevice.GetEventStatus
#define vkGetFenceStatus flextVkDevice.GetFenceStatus
#define vkGetImageMemoryRequirements flextVkDevice.GetImageMemoryRequirements
#define vkGetImageSparseMemoryRequirements flextVkDevice.GetImageSparseMemoryRequirements
#define vkGetImageSubresourceLayout flextVkDevice.GetImageSubresourceLayout
#define vkGetPipelineCacheData flextVkDevice.GetPipelineCacheData
#define vkGetQueryPoolResults flextVkDevice.GetQueryPoolResults
#define vkGetRenderAreaGranularity flextVkDevice.GetRenderAreaGranularity
#define vkInvalidateMappedMemoryRanges flextVkDevice.InvalidateMappedMemoryRanges
#define vkMapMemory flextVkDevice.MapMemory
#define vkMergePipelineCaches flextVkDevice.MergePipelineCaches
#define vkQueueBindSparse flextVkDevice.QueueBindSparse
#define vkQueueSubmit flextVkDevice.QueueSubmit
#define vkQueueWaitIdle flextVkDevice.QueueWaitIdle
#define vkResetCommandBuffer flextVkDevice.ResetCommandBuffer
#define vkResetCommandPool flextVkDevice.ResetCommandPool
#define vkResetDescriptorPool flextVkDevice.ResetDescriptorPool
#define vkResetEvent flextVkDevice.ResetEvent
#define vkResetFences flextVkDevice.ResetFences
#define vkSetEvent flextVkDevice.SetEvent
#define vkUnmapMemory flextVkDevice.UnmapMemory
#define vkUpdateDescriptorSets flextVkDevice.UpdateDescriptorSets
#define vkWaitForFences flextVkDevice.WaitForFences
/* VK_VERSION_1_1 */
#define vkBindBufferMemory2 flextVkDevice.BindBufferMemory2
#define vkBindImageMemory2 flextVkDevice.BindImageMemory2
#define vkCmdDispatchBase flextVkDevice.CmdDispatchBase
#define vkCmdSetDeviceMask flextVkDevice.CmdSetDeviceMask
#define vkCreateDescriptorUpdateTemplate flextVkDevice.CreateDescriptorUpdateTemplate
#define vkCreateSamplerYcbcrConversion flextVkDevice.CreateSamplerYcbcrConversion
#define vkDestroyDescriptorUpdateTemplate flextVkDevice.DestroyDescriptorUpdateTemplate
#define vkDestroySamplerYcbcrConversion flextVkDevice.DestroySamplerYcbcrConversion
#define vkEnumerateInstanceVersion flextVkDevice.EnumerateInstanceVersion
#define vkGetBufferMemoryRequirements2 flextVkDevice.GetBufferMemoryRequirements2
#define vkGetDescriptorSetLayoutSupport flextVkDevice.GetDescriptorSetLayoutSupport
#define vkGetDeviceGroupPeerMemoryFeatures flextVkDevice.GetDeviceGroupPeerMemoryFeatures
#define vkGetDeviceQueue2 flextVkDevice.GetDeviceQueue2
#define vkGetImageMemoryRequirements2 flextVkDevice.GetImageMemoryRequirements2
#define vkGetImageSparseMemoryRequirements2 flextVkDevice.GetImageSparseMemoryRequirements2
#define vkTrimCommandPool flextVkDevice.TrimCommandPool
#define vkUpdateDescriptorSetWithTemplate flextVkDevice.UpdateDescriptorSetWithTemplate
#endif
#ifdef __cplusplus
}
#endif
#endif

73
src/MagnumExternal/Vulkan/flextVkGlobal.h.template vendored

@ -0,0 +1,73 @@
@require(passthru, functions, enums, options, version, extensions)
#ifndef _flextVkGlobal_h_
#define _flextVkGlobal_h_
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
Vladimír Vondruš <mosra@@centrum.cz>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#include "MagnumExternal/Vulkan/flextVk.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef DOXYGEN_GENERATING_OUTPUT /* So the macro names are preserved in the docs */
/* Per-instance function pointers */
extern FLEXTVK_EXPORT FlextVkInstance flextVkInstance;
@for cat,funcs in functions:
@if funcs:
/* VK_@cat */
@for f in funcs:
@if (f.params[0][1] in ['VkInstance', 'VkPhysicalDevice'] or f.name == 'GetDeviceProcAddr') and f.name != 'GetInstanceProcAddr':
#define vk@f.name flextVkInstance.@f.name
@end
@end
@end
@end
/* Per-device function pointers */
extern FLEXTVK_EXPORT FlextVkDevice flextVkDevice;
@for cat,funcs in functions:
@if funcs:
/* VK_@cat */
@for f in funcs:
@if f.params[0][1] not in ['VkInstance', 'VkPhysicalDevice'] and f.name not in ['GetInstanceProcAddr', 'GetDeviceProcAddr', 'EnumerateInstanceExtensionProperties', 'EnumerateInstanceLayerProperties', 'CreateInstance']:
#define vk@f.name flextVkDevice.@f.name
@end
@end
@end
@end
#endif
#ifdef __cplusplus
}
#endif
#endif
Loading…
Cancel
Save