Hi all,
This is an updated version of my first wave of Vulkan patches. Thanks to Henri and Jozef for their feedback. I incorporated your changes and made a few other cosmetic changes.
Thanks, Roderick
Roderick Colenbrander (10): vulkan: Add initial Wine vulkan header. winevulkan: Add stub ICD. winevulkan: Implement vk_icdNegotiateICDInterfaceVersion. winevulkan: Implement global Vulkan function stubs and loading. winevulkan: Define vulkan driver interface. winex11: Add Vulkan stubs. winex11: Implement vkEnumerateInstanceExtensionProperties. winevulkan/winex11: Implement vkCreateInstance. winevulkan: Add instance funcs stubs. winevulkan: Implement vkDestroyInstance.
configure.ac | 10 + dlls/gdi32/Makefile.in | 3 +- dlls/gdi32/dibdrv/dc.c | 2 + dlls/gdi32/driver.c | 6 + dlls/gdi32/enhmfdrv/dc.c | 1 + dlls/gdi32/enhmfdrv/init.c | 1 + dlls/gdi32/freetype.c | 1 + dlls/gdi32/gdi32.spec | 3 + dlls/gdi32/mfdrv/init.c | 1 + dlls/gdi32/path.c | 1 + dlls/gdi32/vulkan.c | 41 + dlls/wineandroid.drv/init.c | 1 + dlls/winemac.drv/gdi.c | 1 + dlls/wineps.drv/init.c | 1 + dlls/winevulkan/Makefile.in | 8 + dlls/winevulkan/version.rc | 27 + dlls/winevulkan/vulkan.c | 224 ++++ dlls/winevulkan/vulkan_private.h | 57 + dlls/winevulkan/vulkan_thunks.c | 101 ++ dlls/winevulkan/vulkan_thunks.h | 12 + dlls/winevulkan/winevulkan.spec | 2 + dlls/winex11.drv/Makefile.in | 1 + dlls/winex11.drv/init.c | 16 + dlls/winex11.drv/vulkan.c | 152 +++ dlls/winex11.drv/x11drv.h | 1 + dlls/winex11.drv/xrender.c | 1 + include/config.h.in | 3 + include/wine/gdi_driver.h | 5 +- include/wine/vulkan.h | 2743 ++++++++++++++++++++++++++++++++++++++ include/wine/vulkan_driver.h | 23 + 30 files changed, 3447 insertions(+), 2 deletions(-) create mode 100644 dlls/gdi32/vulkan.c create mode 100644 dlls/winevulkan/Makefile.in create mode 100644 dlls/winevulkan/version.rc create mode 100644 dlls/winevulkan/vulkan.c create mode 100644 dlls/winevulkan/vulkan_private.h create mode 100644 dlls/winevulkan/vulkan_thunks.c create mode 100644 dlls/winevulkan/vulkan_thunks.h create mode 100644 dlls/winevulkan/winevulkan.spec create mode 100644 dlls/winex11.drv/vulkan.c create mode 100644 include/wine/vulkan.h create mode 100644 include/wine/vulkan_driver.h
This file is directly generated from Vulkan's vk.xml. It contains Core and extension Vulkan types and functions.
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- include/wine/vulkan.h | 2743 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2743 insertions(+) create mode 100644 include/wine/vulkan.h
diff --git a/include/wine/vulkan.h b/include/wine/vulkan.h new file mode 100644 index 0000000000..52e1310d85 --- /dev/null +++ b/include/wine/vulkan.h @@ -0,0 +1,2743 @@ +/* Automatically generated from Vulkan vk.xml; DO NOT EDIT! */ + +#ifndef __WINE_VULKAN_H +#define __WINE_VULKAN_H + +#include <windef.h> +#include <stdint.h> + +#ifndef VKAPI_CALL +#define VKAPI_CALL __stdcall +#endif + +#ifndef VKAPI_PTR +#define VKAPI_PTR VKAPI_CALL +#endif + +/* Callers can override WINE_VK_ALIGN if they want 'host' headers. */ +#ifndef WINE_VK_ALIGN +#define WINE_VK_ALIGN DECLSPEC_ALIGN +#endif + +#define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256 +#define VK_UUID_SIZE 16 +#define VK_LUID_SIZE_KHX 8 +#define VK_MAX_EXTENSION_NAME_SIZE 256 +#define VK_MAX_DESCRIPTION_SIZE 256 +#define VK_MAX_MEMORY_TYPES 32 +#define VK_MAX_MEMORY_HEAPS 16 +#define VK_LOD_CLAMP_NONE 1000.0f +#define VK_REMAINING_MIP_LEVELS (~0U) +#define VK_REMAINING_ARRAY_LAYERS (~0U) +#define VK_WHOLE_SIZE (~0ULL) +#define VK_ATTACHMENT_UNUSED (~0U) +#define VK_TRUE 1 +#define VK_FALSE 0 +#define VK_QUEUE_FAMILY_IGNORED (~0U) +#define VK_QUEUE_FAMILY_EXTERNAL_KHX (~0U-1) +#define VK_SUBPASS_EXTERNAL (~0U) +#define VK_MAX_DEVICE_GROUP_SIZE_KHX 32 + +#define VK_MAKE_VERSION(major, minor, patch) \ + (((major) << 22) | ((minor) << 12) | (patch)) +#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22) +#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) +#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) + +#define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0) +#define VK_HEADER_VERSION 51 +#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; +#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; +#define VK_NULL_HANDLE 0 + +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView) +VK_DEFINE_HANDLE(VkCommandBuffer) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplateKHR) +VK_DEFINE_HANDLE(VkDevice) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView) +VK_DEFINE_HANDLE(VkInstance) +VK_DEFINE_HANDLE(VkPhysicalDevice) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool) +VK_DEFINE_HANDLE(VkQueue) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) + +typedef uint32_t VkBool32; +typedef uint64_t VkDeviceSize; +typedef uint32_t VkFlags; +typedef uint32_t VkSampleMask; + +typedef VkFlags VkAccessFlags; +typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; +typedef VkFlags VkAttachmentDescriptionFlags; +typedef VkFlags VkBufferCreateFlags; +typedef VkFlags VkBufferUsageFlags; +typedef VkFlags VkBufferViewCreateFlags; +typedef VkFlags VkColorComponentFlags; +typedef VkFlags VkCommandBufferResetFlags; +typedef VkFlags VkCommandBufferUsageFlags; +typedef VkFlags VkCommandPoolCreateFlags; +typedef VkFlags VkCommandPoolResetFlags; +typedef VkFlags VkCommandPoolTrimFlagsKHR; +typedef VkFlags VkCompositeAlphaFlagsKHR; +typedef VkFlags VkCullModeFlags; +typedef VkFlags VkDebugReportFlagsEXT; +typedef VkFlags VkDependencyFlags; +typedef VkFlags VkDescriptorPoolCreateFlags; +typedef VkFlags VkDescriptorPoolResetFlags; +typedef VkFlags VkDescriptorSetLayoutCreateFlags; +typedef VkFlags VkDescriptorUpdateTemplateCreateFlagsKHR; +typedef VkFlags VkDeviceCreateFlags; +typedef VkFlags VkDeviceGroupPresentModeFlagsKHX; +typedef VkFlags VkDeviceQueueCreateFlags; +typedef VkFlags VkDisplayModeCreateFlagsKHR; +typedef VkFlags VkDisplayPlaneAlphaFlagsKHR; +typedef VkFlags VkDisplaySurfaceCreateFlagsKHR; +typedef VkFlags VkEventCreateFlags; +typedef VkFlags VkExternalMemoryFeatureFlagsKHX; +typedef VkFlags VkExternalMemoryFeatureFlagsNV; +typedef VkFlags VkExternalMemoryHandleTypeFlagsKHX; +typedef VkFlags VkExternalMemoryHandleTypeFlagsNV; +typedef VkFlags VkExternalSemaphoreFeatureFlagsKHX; +typedef VkFlags VkExternalSemaphoreHandleTypeFlagsKHX; +typedef VkFlags VkFenceCreateFlags; +typedef VkFlags VkFormatFeatureFlags; +typedef VkFlags VkFramebufferCreateFlags; +typedef VkFlags VkIOSSurfaceCreateFlagsMVK; +typedef VkFlags VkImageAspectFlags; +typedef VkFlags VkImageCreateFlags; +typedef VkFlags VkImageUsageFlags; +typedef VkFlags VkImageViewCreateFlags; +typedef VkFlags VkIndirectCommandsLayoutUsageFlagsNVX; +typedef VkFlags VkInstanceCreateFlags; +typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; +typedef VkFlags VkMemoryAllocateFlagsKHX; +typedef VkFlags VkMemoryHeapFlags; +typedef VkFlags VkMemoryMapFlags; +typedef VkFlags VkMemoryPropertyFlags; +typedef VkFlags VkMirSurfaceCreateFlagsKHR; +typedef VkFlags VkObjectEntryUsageFlagsNVX; +typedef VkFlags VkPeerMemoryFeatureFlagsKHX; +typedef VkFlags VkPipelineCacheCreateFlags; +typedef VkFlags VkPipelineColorBlendStateCreateFlags; +typedef VkFlags VkPipelineCreateFlags; +typedef VkFlags VkPipelineDepthStencilStateCreateFlags; +typedef VkFlags VkPipelineDiscardRectangleStateCreateFlagsEXT; +typedef VkFlags VkPipelineDynamicStateCreateFlags; +typedef VkFlags VkPipelineInputAssemblyStateCreateFlags; +typedef VkFlags VkPipelineLayoutCreateFlags; +typedef VkFlags VkPipelineMultisampleStateCreateFlags; +typedef VkFlags VkPipelineRasterizationStateCreateFlags; +typedef VkFlags VkPipelineShaderStageCreateFlags; +typedef VkFlags VkPipelineStageFlags; +typedef VkFlags VkPipelineTessellationStateCreateFlags; +typedef VkFlags VkPipelineVertexInputStateCreateFlags; +typedef VkFlags VkPipelineViewportStateCreateFlags; +typedef VkFlags VkPipelineViewportSwizzleStateCreateFlagsNV; +typedef VkFlags VkQueryControlFlags; +typedef VkFlags VkQueryPipelineStatisticFlags; +typedef VkFlags VkQueryPoolCreateFlags; +typedef VkFlags VkQueryResultFlags; +typedef VkFlags VkQueueFlags; +typedef VkFlags VkRenderPassCreateFlags; +typedef VkFlags VkSampleCountFlags; +typedef VkFlags VkSamplerCreateFlags; +typedef VkFlags VkSemaphoreCreateFlags; +typedef VkFlags VkShaderModuleCreateFlags; +typedef VkFlags VkShaderStageFlags; +typedef VkFlags VkSparseImageFormatFlags; +typedef VkFlags VkSparseMemoryBindFlags; +typedef VkFlags VkStencilFaceFlags; +typedef VkFlags VkSubpassDescriptionFlags; +typedef VkFlags VkSurfaceCounterFlagsEXT; +typedef VkFlags VkSurfaceTransformFlagsKHR; +typedef VkFlags VkSwapchainCreateFlagsKHR; +typedef VkFlags VkViSurfaceCreateFlagsNN; +typedef VkFlags VkWaylandSurfaceCreateFlagsKHR; +typedef VkFlags VkWin32SurfaceCreateFlagsKHR; +typedef VkFlags VkXcbSurfaceCreateFlagsKHR; +typedef VkFlags VkXlibSurfaceCreateFlagsKHR; + +typedef enum VkAccessFlagBits +{ + VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001, + VK_ACCESS_INDEX_READ_BIT = 0x00000002, + VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004, + VK_ACCESS_UNIFORM_READ_BIT = 0x00000008, + VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010, + VK_ACCESS_SHADER_READ_BIT = 0x00000020, + VK_ACCESS_SHADER_WRITE_BIT = 0x00000040, + VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080, + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100, + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200, + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400, + VK_ACCESS_TRANSFER_READ_BIT = 0x00000800, + VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000, + VK_ACCESS_HOST_READ_BIT = 0x00002000, + VK_ACCESS_HOST_WRITE_BIT = 0x00004000, + VK_ACCESS_MEMORY_READ_BIT = 0x00008000, + VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000, + VK_ACCESS_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkAccessFlagBits; + +typedef enum VkAttachmentDescriptionFlagBits +{ + VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 0x00000001, + VK_ATTACHMENT_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkAttachmentDescriptionFlagBits; + +typedef enum VkAttachmentLoadOp +{ + VK_ATTACHMENT_LOAD_OP_LOAD = 0, + VK_ATTACHMENT_LOAD_OP_CLEAR = 1, + VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2, + VK_ATTACHMENT_LOAD_OP_MAX_ENUM = 0x7FFFFFFF, +} VkAttachmentLoadOp; + +typedef enum VkAttachmentStoreOp +{ + VK_ATTACHMENT_STORE_OP_STORE = 0, + VK_ATTACHMENT_STORE_OP_DONT_CARE = 1, + VK_ATTACHMENT_STORE_OP_MAX_ENUM = 0x7FFFFFFF, +} VkAttachmentStoreOp; + +typedef enum VkBlendFactor +{ + VK_BLEND_FACTOR_ZERO = 0, + VK_BLEND_FACTOR_ONE = 1, + VK_BLEND_FACTOR_SRC_COLOR = 2, + VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3, + VK_BLEND_FACTOR_DST_COLOR = 4, + VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 5, + VK_BLEND_FACTOR_SRC_ALPHA = 6, + VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 7, + VK_BLEND_FACTOR_DST_ALPHA = 8, + VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 9, + VK_BLEND_FACTOR_CONSTANT_COLOR = 10, + VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 11, + VK_BLEND_FACTOR_CONSTANT_ALPHA = 12, + VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 13, + VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 14, + VK_BLEND_FACTOR_SRC1_COLOR = 15, + VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 16, + VK_BLEND_FACTOR_SRC1_ALPHA = 17, + VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 18, + VK_BLEND_FACTOR_MAX_ENUM = 0x7FFFFFFF, +} VkBlendFactor; + +typedef enum VkBlendOp +{ + VK_BLEND_OP_ADD = 0, + VK_BLEND_OP_SUBTRACT = 1, + VK_BLEND_OP_REVERSE_SUBTRACT = 2, + VK_BLEND_OP_MIN = 3, + VK_BLEND_OP_MAX = 4, + VK_BLEND_OP_MAX_ENUM = 0x7FFFFFFF, +} VkBlendOp; + +typedef enum VkBorderColor +{ + VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0, + VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 1, + VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 2, + VK_BORDER_COLOR_INT_OPAQUE_BLACK = 3, + VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 4, + VK_BORDER_COLOR_INT_OPAQUE_WHITE = 5, + VK_BORDER_COLOR_MAX_ENUM = 0x7FFFFFFF, +} VkBorderColor; + +typedef enum VkBufferCreateFlagBits +{ + VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, + VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, + VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, + VK_BUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkBufferCreateFlagBits; + +typedef enum VkBufferUsageFlagBits +{ + VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, + VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, + VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, + VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, + VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, + VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, + VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, + VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, + VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkBufferUsageFlagBits; + +typedef enum VkColorComponentFlagBits +{ + VK_COLOR_COMPONENT_R_BIT = 0x00000001, + VK_COLOR_COMPONENT_G_BIT = 0x00000002, + VK_COLOR_COMPONENT_B_BIT = 0x00000004, + VK_COLOR_COMPONENT_A_BIT = 0x00000008, + VK_COLOR_COMPONENT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkColorComponentFlagBits; + +typedef enum VkColorSpaceKHR +{ + VK_COLOR_SPACE_SRGB_NONLINEAR_KHR = 0, + VK_COLOR_SPACE_KHR_MAX_ENUM = 0x7FFFFFFF, +} VkColorSpaceKHR; + +typedef enum VkCommandBufferLevel +{ + VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0, + VK_COMMAND_BUFFER_LEVEL_SECONDARY = 1, + VK_COMMAND_BUFFER_LEVEL_MAX_ENUM = 0x7FFFFFFF, +} VkCommandBufferLevel; + +typedef enum VkCommandBufferUsageFlagBits +{ + VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001, + VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002, + VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004, + VK_COMMAND_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkCommandBufferUsageFlagBits; + +typedef enum VkCommandPoolCreateFlagBits +{ + VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, + VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, + VK_COMMAND_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkCommandPoolCreateFlagBits; + +typedef enum VkCompareOp +{ + VK_COMPARE_OP_NEVER = 0, + VK_COMPARE_OP_LESS = 1, + VK_COMPARE_OP_EQUAL = 2, + VK_COMPARE_OP_LESS_OR_EQUAL = 3, + VK_COMPARE_OP_GREATER = 4, + VK_COMPARE_OP_NOT_EQUAL = 5, + VK_COMPARE_OP_GREATER_OR_EQUAL = 6, + VK_COMPARE_OP_ALWAYS = 7, + VK_COMPARE_OP_MAX_ENUM = 0x7FFFFFFF, +} VkCompareOp; + +typedef enum VkComponentSwizzle +{ + VK_COMPONENT_SWIZZLE_IDENTITY = 0, + VK_COMPONENT_SWIZZLE_ZERO = 1, + VK_COMPONENT_SWIZZLE_ONE = 2, + VK_COMPONENT_SWIZZLE_R = 3, + VK_COMPONENT_SWIZZLE_G = 4, + VK_COMPONENT_SWIZZLE_B = 5, + VK_COMPONENT_SWIZZLE_A = 6, + VK_COMPONENT_SWIZZLE_MAX_ENUM = 0x7FFFFFFF, +} VkComponentSwizzle; + +typedef enum VkCompositeAlphaFlagBitsKHR +{ + VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, + VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002, + VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004, + VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008, + VK_COMPOSITE_ALPHA_FLAG_BITS_KHR_MAX_ENUM = 0x7FFFFFFF, +} VkCompositeAlphaFlagBitsKHR; + +typedef enum VkCullModeFlagBits +{ + VK_CULL_MODE_NONE = 0, + VK_CULL_MODE_FRONT_BIT = 0x00000001, + VK_CULL_MODE_BACK_BIT = 0x00000002, + VK_CULL_MODE_FRONT_AND_BACK = 0x00000003, + VK_CULL_MODE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkCullModeFlagBits; + +typedef enum VkDependencyFlagBits +{ + VK_DEPENDENCY_BY_REGION_BIT = 0x00000001, + VK_DEPENDENCY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkDependencyFlagBits; + +typedef enum VkDescriptorPoolCreateFlagBits +{ + VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, + VK_DESCRIPTOR_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkDescriptorPoolCreateFlagBits; + +typedef enum VkDescriptorSetLayoutCreateFlagBits +{ + VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0x00000001, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkDescriptorSetLayoutCreateFlagBits; + +typedef enum VkDescriptorType +{ + VK_DESCRIPTOR_TYPE_SAMPLER = 0, + VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 1, + VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 2, + VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 3, + VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 4, + VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 5, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 6, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 7, + VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8, + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9, + VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10, + VK_DESCRIPTOR_TYPE_MAX_ENUM = 0x7FFFFFFF, +} VkDescriptorType; + +typedef enum VkDescriptorUpdateTemplateTypeKHR +{ + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR = 0, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR = 1, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_KHR_MAX_ENUM = 0x7FFFFFFF, +} VkDescriptorUpdateTemplateTypeKHR; + +typedef enum VkDynamicState +{ + VK_DYNAMIC_STATE_VIEWPORT = 0, + VK_DYNAMIC_STATE_SCISSOR = 1, + VK_DYNAMIC_STATE_LINE_WIDTH = 2, + VK_DYNAMIC_STATE_DEPTH_BIAS = 3, + VK_DYNAMIC_STATE_BLEND_CONSTANTS = 4, + VK_DYNAMIC_STATE_DEPTH_BOUNDS = 5, + VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6, + VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7, + VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8, + VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000, + VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000, + VK_DYNAMIC_STATE_MAX_ENUM = 0x7FFFFFFF, +} VkDynamicState; + +typedef enum VkFenceCreateFlagBits +{ + VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001, + VK_FENCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkFenceCreateFlagBits; + +typedef enum VkFilter +{ + VK_FILTER_NEAREST = 0, + VK_FILTER_LINEAR = 1, + VK_FILTER_CUBIC_IMG = 1000015000, + VK_FILTER_MAX_ENUM = 0x7FFFFFFF, +} VkFilter; + +typedef enum VkFormat +{ + VK_FORMAT_UNDEFINED = 0, + VK_FORMAT_R4G4_UNORM_PACK8 = 1, + VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2, + VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3, + VK_FORMAT_R5G6B5_UNORM_PACK16 = 4, + VK_FORMAT_B5G6R5_UNORM_PACK16 = 5, + VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6, + VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7, + VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8, + VK_FORMAT_R8_UNORM = 9, + VK_FORMAT_R8_SNORM = 10, + VK_FORMAT_R8_USCALED = 11, + VK_FORMAT_R8_SSCALED = 12, + VK_FORMAT_R8_UINT = 13, + VK_FORMAT_R8_SINT = 14, + VK_FORMAT_R8_SRGB = 15, + VK_FORMAT_R8G8_UNORM = 16, + VK_FORMAT_R8G8_SNORM = 17, + VK_FORMAT_R8G8_USCALED = 18, + VK_FORMAT_R8G8_SSCALED = 19, + VK_FORMAT_R8G8_UINT = 20, + VK_FORMAT_R8G8_SINT = 21, + VK_FORMAT_R8G8_SRGB = 22, + VK_FORMAT_R8G8B8_UNORM = 23, + VK_FORMAT_R8G8B8_SNORM = 24, + VK_FORMAT_R8G8B8_USCALED = 25, + VK_FORMAT_R8G8B8_SSCALED = 26, + VK_FORMAT_R8G8B8_UINT = 27, + VK_FORMAT_R8G8B8_SINT = 28, + VK_FORMAT_R8G8B8_SRGB = 29, + VK_FORMAT_B8G8R8_UNORM = 30, + VK_FORMAT_B8G8R8_SNORM = 31, + VK_FORMAT_B8G8R8_USCALED = 32, + VK_FORMAT_B8G8R8_SSCALED = 33, + VK_FORMAT_B8G8R8_UINT = 34, + VK_FORMAT_B8G8R8_SINT = 35, + VK_FORMAT_B8G8R8_SRGB = 36, + VK_FORMAT_R8G8B8A8_UNORM = 37, + VK_FORMAT_R8G8B8A8_SNORM = 38, + VK_FORMAT_R8G8B8A8_USCALED = 39, + VK_FORMAT_R8G8B8A8_SSCALED = 40, + VK_FORMAT_R8G8B8A8_UINT = 41, + VK_FORMAT_R8G8B8A8_SINT = 42, + VK_FORMAT_R8G8B8A8_SRGB = 43, + VK_FORMAT_B8G8R8A8_UNORM = 44, + VK_FORMAT_B8G8R8A8_SNORM = 45, + VK_FORMAT_B8G8R8A8_USCALED = 46, + VK_FORMAT_B8G8R8A8_SSCALED = 47, + VK_FORMAT_B8G8R8A8_UINT = 48, + VK_FORMAT_B8G8R8A8_SINT = 49, + VK_FORMAT_B8G8R8A8_SRGB = 50, + VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51, + VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52, + VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53, + VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54, + VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55, + VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56, + VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57, + VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58, + VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59, + VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60, + VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61, + VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62, + VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63, + VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64, + VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65, + VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66, + VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67, + VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68, + VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69, + VK_FORMAT_R16_UNORM = 70, + VK_FORMAT_R16_SNORM = 71, + VK_FORMAT_R16_USCALED = 72, + VK_FORMAT_R16_SSCALED = 73, + VK_FORMAT_R16_UINT = 74, + VK_FORMAT_R16_SINT = 75, + VK_FORMAT_R16_SFLOAT = 76, + VK_FORMAT_R16G16_UNORM = 77, + VK_FORMAT_R16G16_SNORM = 78, + VK_FORMAT_R16G16_USCALED = 79, + VK_FORMAT_R16G16_SSCALED = 80, + VK_FORMAT_R16G16_UINT = 81, + VK_FORMAT_R16G16_SINT = 82, + VK_FORMAT_R16G16_SFLOAT = 83, + VK_FORMAT_R16G16B16_UNORM = 84, + VK_FORMAT_R16G16B16_SNORM = 85, + VK_FORMAT_R16G16B16_USCALED = 86, + VK_FORMAT_R16G16B16_SSCALED = 87, + VK_FORMAT_R16G16B16_UINT = 88, + VK_FORMAT_R16G16B16_SINT = 89, + VK_FORMAT_R16G16B16_SFLOAT = 90, + VK_FORMAT_R16G16B16A16_UNORM = 91, + VK_FORMAT_R16G16B16A16_SNORM = 92, + VK_FORMAT_R16G16B16A16_USCALED = 93, + VK_FORMAT_R16G16B16A16_SSCALED = 94, + VK_FORMAT_R16G16B16A16_UINT = 95, + VK_FORMAT_R16G16B16A16_SINT = 96, + VK_FORMAT_R16G16B16A16_SFLOAT = 97, + VK_FORMAT_R32_UINT = 98, + VK_FORMAT_R32_SINT = 99, + VK_FORMAT_R32_SFLOAT = 100, + VK_FORMAT_R32G32_UINT = 101, + VK_FORMAT_R32G32_SINT = 102, + VK_FORMAT_R32G32_SFLOAT = 103, + VK_FORMAT_R32G32B32_UINT = 104, + VK_FORMAT_R32G32B32_SINT = 105, + VK_FORMAT_R32G32B32_SFLOAT = 106, + VK_FORMAT_R32G32B32A32_UINT = 107, + VK_FORMAT_R32G32B32A32_SINT = 108, + VK_FORMAT_R32G32B32A32_SFLOAT = 109, + VK_FORMAT_R64_UINT = 110, + VK_FORMAT_R64_SINT = 111, + VK_FORMAT_R64_SFLOAT = 112, + VK_FORMAT_R64G64_UINT = 113, + VK_FORMAT_R64G64_SINT = 114, + VK_FORMAT_R64G64_SFLOAT = 115, + VK_FORMAT_R64G64B64_UINT = 116, + VK_FORMAT_R64G64B64_SINT = 117, + VK_FORMAT_R64G64B64_SFLOAT = 118, + VK_FORMAT_R64G64B64A64_UINT = 119, + VK_FORMAT_R64G64B64A64_SINT = 120, + VK_FORMAT_R64G64B64A64_SFLOAT = 121, + VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122, + VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123, + VK_FORMAT_D16_UNORM = 124, + VK_FORMAT_X8_D24_UNORM_PACK32 = 125, + VK_FORMAT_D32_SFLOAT = 126, + VK_FORMAT_S8_UINT = 127, + VK_FORMAT_D16_UNORM_S8_UINT = 128, + VK_FORMAT_D24_UNORM_S8_UINT = 129, + VK_FORMAT_D32_SFLOAT_S8_UINT = 130, + VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131, + VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132, + VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133, + VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134, + VK_FORMAT_BC2_UNORM_BLOCK = 135, + VK_FORMAT_BC2_SRGB_BLOCK = 136, + VK_FORMAT_BC3_UNORM_BLOCK = 137, + VK_FORMAT_BC3_SRGB_BLOCK = 138, + VK_FORMAT_BC4_UNORM_BLOCK = 139, + VK_FORMAT_BC4_SNORM_BLOCK = 140, + VK_FORMAT_BC5_UNORM_BLOCK = 141, + VK_FORMAT_BC5_SNORM_BLOCK = 142, + VK_FORMAT_BC6H_UFLOAT_BLOCK = 143, + VK_FORMAT_BC6H_SFLOAT_BLOCK = 144, + VK_FORMAT_BC7_UNORM_BLOCK = 145, + VK_FORMAT_BC7_SRGB_BLOCK = 146, + VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147, + VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148, + VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149, + VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150, + VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151, + VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152, + VK_FORMAT_EAC_R11_UNORM_BLOCK = 153, + VK_FORMAT_EAC_R11_SNORM_BLOCK = 154, + VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155, + VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156, + VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157, + VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158, + VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159, + VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160, + VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161, + VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162, + VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163, + VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164, + VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165, + VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166, + VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167, + VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168, + VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169, + VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170, + VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171, + VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172, + VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173, + VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174, + VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175, + VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176, + VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, + VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, + VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, + VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, + VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, + VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, + VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, + VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, + VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000, + VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001, + VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002, + VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003, + VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004, + VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005, + VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006, + VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007, + VK_FORMAT_MAX_ENUM = 0x7FFFFFFF, +} VkFormat; + +typedef enum VkFormatFeatureFlagBits +{ + VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, + VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, + VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, + VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, + VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, + VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, + VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, + VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, + VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, + VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, + VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, + VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000, + VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = 0x00004000, + VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = 0x00008000, + VK_FORMAT_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkFormatFeatureFlagBits; + +typedef enum VkFrontFace +{ + VK_FRONT_FACE_COUNTER_CLOCKWISE = 0, + VK_FRONT_FACE_CLOCKWISE = 1, + VK_FRONT_FACE_MAX_ENUM = 0x7FFFFFFF, +} VkFrontFace; + +typedef enum VkImageAspectFlagBits +{ + VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001, + VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002, + VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004, + VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008, + VK_IMAGE_ASPECT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkImageAspectFlagBits; + +typedef enum VkImageCreateFlagBits +{ + VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, + VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, + VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004, + VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, + VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, + VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = 0x00000020, + VK_IMAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkImageCreateFlagBits; + +typedef enum VkImageLayout +{ + VK_IMAGE_LAYOUT_UNDEFINED = 0, + VK_IMAGE_LAYOUT_GENERAL = 1, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3, + VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4, + VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5, + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6, + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7, + VK_IMAGE_LAYOUT_PREINITIALIZED = 8, + VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002, + VK_IMAGE_LAYOUT_MAX_ENUM = 0x7FFFFFFF, +} VkImageLayout; + +typedef enum VkImageTiling +{ + VK_IMAGE_TILING_OPTIMAL = 0, + VK_IMAGE_TILING_LINEAR = 1, + VK_IMAGE_TILING_MAX_ENUM = 0x7FFFFFFF, +} VkImageTiling; + +typedef enum VkImageType +{ + VK_IMAGE_TYPE_1D = 0, + VK_IMAGE_TYPE_2D = 1, + VK_IMAGE_TYPE_3D = 2, + VK_IMAGE_TYPE_MAX_ENUM = 0x7FFFFFFF, +} VkImageType; + +typedef enum VkImageUsageFlagBits +{ + VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, + VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, + VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, + VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, + VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, + VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, + VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, + VK_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkImageUsageFlagBits; + +typedef enum VkImageViewType +{ + VK_IMAGE_VIEW_TYPE_1D = 0, + VK_IMAGE_VIEW_TYPE_2D = 1, + VK_IMAGE_VIEW_TYPE_3D = 2, + VK_IMAGE_VIEW_TYPE_CUBE = 3, + VK_IMAGE_VIEW_TYPE_1D_ARRAY = 4, + VK_IMAGE_VIEW_TYPE_2D_ARRAY = 5, + VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 6, + VK_IMAGE_VIEW_TYPE_MAX_ENUM = 0x7FFFFFFF, +} VkImageViewType; + +typedef enum VkIndexType +{ + VK_INDEX_TYPE_UINT16 = 0, + VK_INDEX_TYPE_UINT32 = 1, + VK_INDEX_TYPE_MAX_ENUM = 0x7FFFFFFF, +} VkIndexType; + +typedef enum VkInternalAllocationType +{ + VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0, + VK_INTERNAL_ALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF, +} VkInternalAllocationType; + +typedef enum VkLogicOp +{ + VK_LOGIC_OP_CLEAR = 0, + VK_LOGIC_OP_AND = 1, + VK_LOGIC_OP_AND_REVERSE = 2, + VK_LOGIC_OP_COPY = 3, + VK_LOGIC_OP_AND_INVERTED = 4, + VK_LOGIC_OP_NO_OP = 5, + VK_LOGIC_OP_XOR = 6, + VK_LOGIC_OP_OR = 7, + VK_LOGIC_OP_NOR = 8, + VK_LOGIC_OP_EQUIVALENT = 9, + VK_LOGIC_OP_INVERT = 10, + VK_LOGIC_OP_OR_REVERSE = 11, + VK_LOGIC_OP_COPY_INVERTED = 12, + VK_LOGIC_OP_OR_INVERTED = 13, + VK_LOGIC_OP_NAND = 14, + VK_LOGIC_OP_SET = 15, + VK_LOGIC_OP_MAX_ENUM = 0x7FFFFFFF, +} VkLogicOp; + +typedef enum VkMemoryHeapFlagBits +{ + VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001, + VK_MEMORY_HEAP_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkMemoryHeapFlagBits; + +typedef enum VkMemoryPropertyFlagBits +{ + VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002, + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004, + VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008, + VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010, + VK_MEMORY_PROPERTY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkMemoryPropertyFlagBits; + +typedef enum VkObjectType +{ + VK_OBJECT_TYPE_UNKNOWN = 0, + VK_OBJECT_TYPE_INSTANCE = 1, + VK_OBJECT_TYPE_PHYSICAL_DEVICE = 2, + VK_OBJECT_TYPE_DEVICE = 3, + VK_OBJECT_TYPE_QUEUE = 4, + VK_OBJECT_TYPE_SEMAPHORE = 5, + VK_OBJECT_TYPE_COMMAND_BUFFER = 6, + VK_OBJECT_TYPE_FENCE = 7, + VK_OBJECT_TYPE_DEVICE_MEMORY = 8, + VK_OBJECT_TYPE_BUFFER = 9, + VK_OBJECT_TYPE_IMAGE = 10, + VK_OBJECT_TYPE_EVENT = 11, + VK_OBJECT_TYPE_QUERY_POOL = 12, + VK_OBJECT_TYPE_BUFFER_VIEW = 13, + VK_OBJECT_TYPE_IMAGE_VIEW = 14, + VK_OBJECT_TYPE_SHADER_MODULE = 15, + VK_OBJECT_TYPE_PIPELINE_CACHE = 16, + VK_OBJECT_TYPE_PIPELINE_LAYOUT = 17, + VK_OBJECT_TYPE_RENDER_PASS = 18, + VK_OBJECT_TYPE_PIPELINE = 19, + VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT = 20, + VK_OBJECT_TYPE_SAMPLER = 21, + VK_OBJECT_TYPE_DESCRIPTOR_POOL = 22, + VK_OBJECT_TYPE_DESCRIPTOR_SET = 23, + VK_OBJECT_TYPE_FRAMEBUFFER = 24, + VK_OBJECT_TYPE_COMMAND_POOL = 25, + VK_OBJECT_TYPE_SURFACE_KHR = 1000000000, + VK_OBJECT_TYPE_SWAPCHAIN_KHR = 1000001000, + VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR = 1000085000, + VK_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF, +} VkObjectType; + +typedef enum VkPhysicalDeviceType +{ + VK_PHYSICAL_DEVICE_TYPE_OTHER = 0, + VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1, + VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2, + VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3, + VK_PHYSICAL_DEVICE_TYPE_CPU = 4, + VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM = 0x7FFFFFFF, +} VkPhysicalDeviceType; + +typedef enum VkPipelineBindPoint +{ + VK_PIPELINE_BIND_POINT_GRAPHICS = 0, + VK_PIPELINE_BIND_POINT_COMPUTE = 1, + VK_PIPELINE_BIND_POINT_MAX_ENUM = 0x7FFFFFFF, +} VkPipelineBindPoint; + +typedef enum VkPipelineCacheHeaderVersion +{ + VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1, + VK_PIPELINE_CACHE_HEADER_VERSION_MAX_ENUM = 0x7FFFFFFF, +} VkPipelineCacheHeaderVersion; + +typedef enum VkPipelineCreateFlagBits +{ + VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001, + VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002, + VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, + VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkPipelineCreateFlagBits; + +typedef enum VkPipelineStageFlagBits +{ + VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, + VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, + VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, + VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, + VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, + VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, + VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, + VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, + VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, + VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, + VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000, + VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, + VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, + VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, + VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkPipelineStageFlagBits; + +typedef enum VkPolygonMode +{ + VK_POLYGON_MODE_FILL = 0, + VK_POLYGON_MODE_LINE = 1, + VK_POLYGON_MODE_POINT = 2, + VK_POLYGON_MODE_MAX_ENUM = 0x7FFFFFFF, +} VkPolygonMode; + +typedef enum VkPresentModeKHR +{ + VK_PRESENT_MODE_IMMEDIATE_KHR = 0, + VK_PRESENT_MODE_MAILBOX_KHR = 1, + VK_PRESENT_MODE_FIFO_KHR = 2, + VK_PRESENT_MODE_FIFO_RELAXED_KHR = 3, + VK_PRESENT_MODE_KHR_MAX_ENUM = 0x7FFFFFFF, +} VkPresentModeKHR; + +typedef enum VkPrimitiveTopology +{ + VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0, + VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 1, + VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 2, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 3, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 4, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 5, + VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 6, + VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 7, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 8, + VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 9, + VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 10, + VK_PRIMITIVE_TOPOLOGY_MAX_ENUM = 0x7FFFFFFF, +} VkPrimitiveTopology; + +typedef enum VkQueryControlFlagBits +{ + VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001, + VK_QUERY_CONTROL_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkQueryControlFlagBits; + +typedef enum VkQueryPipelineStatisticFlagBits +{ + VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, + VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, + VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, + VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, + VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, + VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, + VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, + VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, + VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, + VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, + VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, + VK_QUERY_PIPELINE_STATISTIC_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkQueryPipelineStatisticFlagBits; + +typedef enum VkQueryType +{ + VK_QUERY_TYPE_OCCLUSION = 0, + VK_QUERY_TYPE_PIPELINE_STATISTICS = 1, + VK_QUERY_TYPE_TIMESTAMP = 2, + VK_QUERY_TYPE_MAX_ENUM = 0x7FFFFFFF, +} VkQueryType; + +typedef enum VkQueueFlagBits +{ + VK_QUEUE_GRAPHICS_BIT = 0x00000001, + VK_QUEUE_COMPUTE_BIT = 0x00000002, + VK_QUEUE_TRANSFER_BIT = 0x00000004, + VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, + VK_QUEUE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkQueueFlagBits; + +typedef enum VkResult +{ + VK_ERROR_OUT_OF_POOL_MEMORY_KHR = -1000069000, + VK_ERROR_INVALID_SHADER_NV = -1000012000, + VK_ERROR_OUT_OF_DATE_KHR = -1000001004, + VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001, + VK_ERROR_SURFACE_LOST_KHR = -1000000000, + VK_ERROR_FRAGMENTED_POOL = -12, + VK_ERROR_FORMAT_NOT_SUPPORTED = -11, + VK_ERROR_TOO_MANY_OBJECTS = -10, + VK_ERROR_INCOMPATIBLE_DRIVER = -9, + VK_ERROR_FEATURE_NOT_PRESENT = -8, + VK_ERROR_EXTENSION_NOT_PRESENT = -7, + VK_ERROR_LAYER_NOT_PRESENT = -6, + VK_ERROR_MEMORY_MAP_FAILED = -5, + VK_ERROR_DEVICE_LOST = -4, + VK_ERROR_INITIALIZATION_FAILED = -3, + VK_ERROR_OUT_OF_DEVICE_MEMORY = -2, + VK_ERROR_OUT_OF_HOST_MEMORY = -1, + VK_SUCCESS = 0, + VK_NOT_READY = 1, + VK_TIMEOUT = 2, + VK_EVENT_SET = 3, + VK_EVENT_RESET = 4, + VK_INCOMPLETE = 5, + VK_SUBOPTIMAL_KHR = 1000001003, + VK_RESULT_MAX_ENUM = 0x7FFFFFFF, +} VkResult; + +typedef enum VkSampleCountFlagBits +{ + VK_SAMPLE_COUNT_1_BIT = 0x00000001, + VK_SAMPLE_COUNT_2_BIT = 0x00000002, + VK_SAMPLE_COUNT_4_BIT = 0x00000004, + VK_SAMPLE_COUNT_8_BIT = 0x00000008, + VK_SAMPLE_COUNT_16_BIT = 0x00000010, + VK_SAMPLE_COUNT_32_BIT = 0x00000020, + VK_SAMPLE_COUNT_64_BIT = 0x00000040, + VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkSampleCountFlagBits; + +typedef enum VkSamplerAddressMode +{ + VK_SAMPLER_ADDRESS_MODE_REPEAT = 0, + VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 1, + VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 2, + VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 3, + VK_SAMPLER_ADDRESS_MODE_MAX_ENUM = 0x7FFFFFFF, +} VkSamplerAddressMode; + +typedef enum VkSamplerMipmapMode +{ + VK_SAMPLER_MIPMAP_MODE_NEAREST = 0, + VK_SAMPLER_MIPMAP_MODE_LINEAR = 1, + VK_SAMPLER_MIPMAP_MODE_MAX_ENUM = 0x7FFFFFFF, +} VkSamplerMipmapMode; + +typedef enum VkShaderStageFlagBits +{ + VK_SHADER_STAGE_VERTEX_BIT = 0x00000001, + VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002, + VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004, + VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008, + VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010, + VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F, + VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020, + VK_SHADER_STAGE_ALL = 0x7FFFFFFF, + VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkShaderStageFlagBits; + +typedef enum VkSharingMode +{ + VK_SHARING_MODE_EXCLUSIVE = 0, + VK_SHARING_MODE_CONCURRENT = 1, + VK_SHARING_MODE_MAX_ENUM = 0x7FFFFFFF, +} VkSharingMode; + +typedef enum VkSparseImageFormatFlagBits +{ + VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, + VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = 0x00000002, + VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, + VK_SPARSE_IMAGE_FORMAT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkSparseImageFormatFlagBits; + +typedef enum VkSparseMemoryBindFlagBits +{ + VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001, + VK_SPARSE_MEMORY_BIND_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkSparseMemoryBindFlagBits; + +typedef enum VkStencilOp +{ + VK_STENCIL_OP_KEEP = 0, + VK_STENCIL_OP_ZERO = 1, + VK_STENCIL_OP_REPLACE = 2, + VK_STENCIL_OP_INCREMENT_AND_CLAMP = 3, + VK_STENCIL_OP_DECREMENT_AND_CLAMP = 4, + VK_STENCIL_OP_INVERT = 5, + VK_STENCIL_OP_INCREMENT_AND_WRAP = 6, + VK_STENCIL_OP_DECREMENT_AND_WRAP = 7, + VK_STENCIL_OP_MAX_ENUM = 0x7FFFFFFF, +} VkStencilOp; + +typedef enum VkStructureType +{ + VK_STRUCTURE_TYPE_APPLICATION_INFO = 0, + VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1, + VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2, + VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3, + VK_STRUCTURE_TYPE_SUBMIT_INFO = 4, + VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5, + VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6, + VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7, + VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8, + VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9, + VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10, + VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11, + VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12, + VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13, + VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14, + VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15, + VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16, + VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17, + VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18, + VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19, + VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20, + VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23, + VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24, + VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25, + VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26, + VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27, + VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28, + VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29, + VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30, + VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32, + VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34, + VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35, + VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36, + VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37, + VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38, + VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41, + VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42, + VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43, + VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44, + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45, + VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46, + VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47, + VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48, + VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, + VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, + VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000, + VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000, + VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001, + VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002, + VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001, + VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002, + VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004, + VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006, + VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR = 1000080000, + VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000, + VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR = 1000085000, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV = 1000087000, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV = 1000098000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = 1000099000, + VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = 1000099001, + VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000, + VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF, +} VkStructureType; + +typedef enum VkSubpassContents +{ + VK_SUBPASS_CONTENTS_INLINE = 0, + VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1, + VK_SUBPASS_CONTENTS_MAX_ENUM = 0x7FFFFFFF, +} VkSubpassContents; + +typedef enum VkSubpassDescriptionFlagBits +{ + VK_SUBPASS_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF, +} VkSubpassDescriptionFlagBits; + +typedef enum VkSurfaceTransformFlagBitsKHR +{ + VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001, + VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002, + VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004, + VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040, + VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080, + VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100, + VK_SURFACE_TRANSFORM_FLAG_BITS_KHR_MAX_ENUM = 0x7FFFFFFF, +} VkSurfaceTransformFlagBitsKHR; + +typedef enum VkSwapchainCreateFlagBitsKHR +{ + VK_SWAPCHAIN_CREATE_FLAG_BITS_KHR_MAX_ENUM = 0x7FFFFFFF, +} VkSwapchainCreateFlagBitsKHR; + +typedef enum VkSystemAllocationScope +{ + VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0, + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 1, + VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 2, + VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 3, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 4, + VK_SYSTEM_ALLOCATION_SCOPE_MAX_ENUM = 0x7FFFFFFF, +} VkSystemAllocationScope; + +typedef enum VkVertexInputRate +{ + VK_VERTEX_INPUT_RATE_VERTEX = 0, + VK_VERTEX_INPUT_RATE_INSTANCE = 1, + VK_VERTEX_INPUT_RATE_MAX_ENUM = 0x7FFFFFFF, +} VkVertexInputRate; + +typedef void* (VKAPI_PTR * PFN_vkAllocationFunction)( + void *pUserData, + const size_t size, + const size_t alignment, + const VkSystemAllocationScope allocationScope); +typedef void (VKAPI_PTR * PFN_vkFreeFunction)( + void *pUserData, + const void *pMemory); +typedef void (VKAPI_PTR * PFN_vkInternalAllocationNotification)( + void *pUserData, + const size_t size, + const VkInternalAllocationType allocationType, + const VkSystemAllocationScope allocationScope); +typedef void (VKAPI_PTR * PFN_vkInternalFreeNotification)( + void *pUserData, + const size_t size, + const VkInternalAllocationType allocationType, + const VkSystemAllocationScope allocationScope); +typedef void* (VKAPI_PTR * PFN_vkReallocationFunction)( + void *pUserData, + const void *pOriginal, + const size_t size, + const size_t alignment, + const VkSystemAllocationScope allocationScope); +typedef void (VKAPI_PTR * PFN_vkVoidFunction)( +void); + +typedef struct VkAttachmentDescription +{ + VkAttachmentDescriptionFlags flags; + VkFormat format; + VkSampleCountFlagBits samples; + VkAttachmentLoadOp loadOp; + VkAttachmentStoreOp storeOp; + VkAttachmentLoadOp stencilLoadOp; + VkAttachmentStoreOp stencilStoreOp; + VkImageLayout initialLayout; + VkImageLayout finalLayout; +} VkAttachmentDescription; + +typedef struct VkBufferCopy +{ + VkDeviceSize WINE_VK_ALIGN(8) srcOffset; + VkDeviceSize WINE_VK_ALIGN(8) dstOffset; + VkDeviceSize WINE_VK_ALIGN(8) size; +} VkBufferCopy; + +typedef struct VkBufferMemoryBarrier +{ + VkStructureType sType; + const void *pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + uint32_t srcQueueFamilyIndex; + uint32_t dstQueueFamilyIndex; + VkBuffer WINE_VK_ALIGN(8) buffer; + VkDeviceSize WINE_VK_ALIGN(8) offset; + VkDeviceSize WINE_VK_ALIGN(8) size; +} VkBufferMemoryBarrier; + +typedef union VkClearColorValue +{ + float float32[4]; + int32_t int32[4]; + uint32_t uint32[4]; +} VkClearColorValue; + +typedef struct VkCommandBufferAllocateInfo +{ + VkStructureType sType; + const void *pNext; + VkCommandPool WINE_VK_ALIGN(8) commandPool; + VkCommandBufferLevel level; + uint32_t commandBufferCount; +} VkCommandBufferAllocateInfo; + +typedef struct VkCommandBufferInheritanceInfo +{ + VkStructureType sType; + const void *pNext; + VkRenderPass WINE_VK_ALIGN(8) renderPass; + uint32_t subpass; + VkFramebuffer WINE_VK_ALIGN(8) framebuffer; + VkBool32 occlusionQueryEnable; + VkQueryControlFlags queryFlags; + VkQueryPipelineStatisticFlags pipelineStatistics; +} VkCommandBufferInheritanceInfo; + +typedef struct VkComponentMapping +{ + VkComponentSwizzle r; + VkComponentSwizzle g; + VkComponentSwizzle b; + VkComponentSwizzle a; +} VkComponentMapping; + +typedef struct VkCopyDescriptorSet +{ + VkStructureType sType; + const void *pNext; + VkDescriptorSet WINE_VK_ALIGN(8) srcSet; + uint32_t srcBinding; + uint32_t srcArrayElement; + VkDescriptorSet WINE_VK_ALIGN(8) dstSet; + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; +} VkCopyDescriptorSet; + +typedef struct VkDescriptorImageInfo +{ + VkSampler WINE_VK_ALIGN(8) sampler; + VkImageView WINE_VK_ALIGN(8) imageView; + VkImageLayout imageLayout; +} VkDescriptorImageInfo; + +typedef struct VkDescriptorPoolSize +{ + VkDescriptorType type; + uint32_t descriptorCount; +} VkDescriptorPoolSize; + +typedef struct VkDescriptorSetLayoutBinding +{ + uint32_t binding; + VkDescriptorType descriptorType; + uint32_t descriptorCount; + VkShaderStageFlags stageFlags; + const VkSampler *pImmutableSamplers; +} VkDescriptorSetLayoutBinding; + +typedef struct VkDescriptorUpdateTemplateEntryKHR +{ + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + VkDescriptorType descriptorType; + size_t offset; + size_t stride; +} VkDescriptorUpdateTemplateEntryKHR; + +typedef struct VkDispatchIndirectCommand +{ + uint32_t x; + uint32_t y; + uint32_t z; +} VkDispatchIndirectCommand; + +typedef struct VkDrawIndirectCommand +{ + uint32_t vertexCount; + uint32_t instanceCount; + uint32_t firstVertex; + uint32_t firstInstance; +} VkDrawIndirectCommand; + +typedef struct VkExtensionProperties +{ + char extensionName[VK_MAX_EXTENSION_NAME_SIZE]; + uint32_t specVersion; +} VkExtensionProperties; + +typedef struct VkExtent3D +{ + uint32_t width; + uint32_t height; + uint32_t depth; +} VkExtent3D; + +typedef struct VkFormatProperties +{ + VkFormatFeatureFlags linearTilingFeatures; + VkFormatFeatureFlags optimalTilingFeatures; + VkFormatFeatureFlags bufferFeatures; +} VkFormatProperties; + +typedef struct VkFramebufferCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkFramebufferCreateFlags flags; + VkRenderPass WINE_VK_ALIGN(8) renderPass; + uint32_t attachmentCount; + const VkImageView *pAttachments; + uint32_t width; + uint32_t height; + uint32_t layers; +} VkFramebufferCreateInfo; + +typedef struct VkImageCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkImageCreateFlags flags; + VkImageType imageType; + VkFormat format; + VkExtent3D extent; + uint32_t mipLevels; + uint32_t arrayLayers; + VkSampleCountFlagBits samples; + VkImageTiling tiling; + VkImageUsageFlags usage; + VkSharingMode sharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t *pQueueFamilyIndices; + VkImageLayout initialLayout; +} VkImageCreateInfo; + +typedef struct VkImageSubresource +{ + VkImageAspectFlags aspectMask; + uint32_t mipLevel; + uint32_t arrayLayer; +} VkImageSubresource; + +typedef struct VkImageSubresourceRange +{ + VkImageAspectFlags aspectMask; + uint32_t baseMipLevel; + uint32_t levelCount; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkImageSubresourceRange; + +typedef struct VkImageViewCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkImageViewCreateFlags flags; + VkImage WINE_VK_ALIGN(8) image; + VkImageViewType viewType; + VkFormat format; + VkComponentMapping components; + VkImageSubresourceRange subresourceRange; +} VkImageViewCreateInfo; + +typedef struct VkLayerProperties +{ + char layerName[VK_MAX_EXTENSION_NAME_SIZE]; + uint32_t specVersion; + uint32_t implementationVersion; + char description[VK_MAX_DESCRIPTION_SIZE]; +} VkLayerProperties; + +typedef struct VkMappedMemoryRange +{ + VkStructureType sType; + const void *pNext; + VkDeviceMemory WINE_VK_ALIGN(8) memory; + VkDeviceSize WINE_VK_ALIGN(8) offset; + VkDeviceSize WINE_VK_ALIGN(8) size; +} VkMappedMemoryRange; + +typedef struct VkMemoryAllocateInfo +{ + VkStructureType sType; + const void *pNext; + VkDeviceSize WINE_VK_ALIGN(8) allocationSize; + uint32_t memoryTypeIndex; +} VkMemoryAllocateInfo; + +typedef struct VkMemoryRequirements +{ + VkDeviceSize WINE_VK_ALIGN(8) size; + VkDeviceSize WINE_VK_ALIGN(8) alignment; + uint32_t memoryTypeBits; +} VkMemoryRequirements; + +typedef struct VkOffset3D +{ + int32_t x; + int32_t y; + int32_t z; +} VkOffset3D; + +typedef struct VkPhysicalDeviceFeatures +{ + VkBool32 robustBufferAccess; + VkBool32 fullDrawIndexUint32; + VkBool32 imageCubeArray; + VkBool32 independentBlend; + VkBool32 geometryShader; + VkBool32 tessellationShader; + VkBool32 sampleRateShading; + VkBool32 dualSrcBlend; + VkBool32 logicOp; + VkBool32 multiDrawIndirect; + VkBool32 drawIndirectFirstInstance; + VkBool32 depthClamp; + VkBool32 depthBiasClamp; + VkBool32 fillModeNonSolid; + VkBool32 depthBounds; + VkBool32 wideLines; + VkBool32 largePoints; + VkBool32 alphaToOne; + VkBool32 multiViewport; + VkBool32 samplerAnisotropy; + VkBool32 textureCompressionETC2; + VkBool32 textureCompressionASTC_LDR; + VkBool32 textureCompressionBC; + VkBool32 occlusionQueryPrecise; + VkBool32 pipelineStatisticsQuery; + VkBool32 vertexPipelineStoresAndAtomics; + VkBool32 fragmentStoresAndAtomics; + VkBool32 shaderTessellationAndGeometryPointSize; + VkBool32 shaderImageGatherExtended; + VkBool32 shaderStorageImageExtendedFormats; + VkBool32 shaderStorageImageMultisample; + VkBool32 shaderStorageImageReadWithoutFormat; + VkBool32 shaderStorageImageWriteWithoutFormat; + VkBool32 shaderUniformBufferArrayDynamicIndexing; + VkBool32 shaderSampledImageArrayDynamicIndexing; + VkBool32 shaderStorageBufferArrayDynamicIndexing; + VkBool32 shaderStorageImageArrayDynamicIndexing; + VkBool32 shaderClipDistance; + VkBool32 shaderCullDistance; + VkBool32 shaderFloat64; + VkBool32 shaderInt64; + VkBool32 shaderInt16; + VkBool32 shaderResourceResidency; + VkBool32 shaderResourceMinLod; + VkBool32 sparseBinding; + VkBool32 sparseResidencyBuffer; + VkBool32 sparseResidencyImage2D; + VkBool32 sparseResidencyImage3D; + VkBool32 sparseResidency2Samples; + VkBool32 sparseResidency4Samples; + VkBool32 sparseResidency8Samples; + VkBool32 sparseResidency16Samples; + VkBool32 sparseResidencyAliased; + VkBool32 variableMultisampleRate; + VkBool32 inheritedQueries; +} VkPhysicalDeviceFeatures; + +typedef struct VkPhysicalDeviceImageFormatInfo2KHR +{ + VkStructureType sType; + const void *pNext; + VkFormat format; + VkImageType type; + VkImageTiling tiling; + VkImageUsageFlags usage; + VkImageCreateFlags flags; +} VkPhysicalDeviceImageFormatInfo2KHR; + +typedef struct VkPhysicalDeviceSparseProperties +{ + VkBool32 residencyStandard2DBlockShape; + VkBool32 residencyStandard2DMultisampleBlockShape; + VkBool32 residencyStandard3DBlockShape; + VkBool32 residencyAlignedMipSize; + VkBool32 residencyNonResidentStrict; +} VkPhysicalDeviceSparseProperties; + +typedef struct VkPipelineCacheCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineCacheCreateFlags flags; + size_t initialDataSize; + const void *pInitialData; +} VkPipelineCacheCreateInfo; + +typedef struct VkPipelineInputAssemblyStateCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineInputAssemblyStateCreateFlags flags; + VkPrimitiveTopology topology; + VkBool32 primitiveRestartEnable; +} VkPipelineInputAssemblyStateCreateInfo; + +typedef struct VkPipelineMultisampleStateCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineMultisampleStateCreateFlags flags; + VkSampleCountFlagBits rasterizationSamples; + VkBool32 sampleShadingEnable; + float minSampleShading; + const VkSampleMask *pSampleMask; + VkBool32 alphaToCoverageEnable; + VkBool32 alphaToOneEnable; +} VkPipelineMultisampleStateCreateInfo; + +typedef struct VkPipelineTessellationStateCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineTessellationStateCreateFlags flags; + uint32_t patchControlPoints; +} VkPipelineTessellationStateCreateInfo; + +typedef struct VkPresentInfoKHR +{ + VkStructureType sType; + const void *pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore *pWaitSemaphores; + uint32_t swapchainCount; + const VkSwapchainKHR *pSwapchains; + const uint32_t *pImageIndices; + VkResult *pResults; +} VkPresentInfoKHR; + +typedef struct VkQueryPoolCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkQueryPoolCreateFlags flags; + VkQueryType queryType; + uint32_t queryCount; + VkQueryPipelineStatisticFlags pipelineStatistics; +} VkQueryPoolCreateInfo; + +typedef struct VkSemaphoreCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkSemaphoreCreateFlags flags; +} VkSemaphoreCreateInfo; + +typedef struct VkSparseImageFormatProperties +{ + VkImageAspectFlags aspectMask; + VkExtent3D imageGranularity; + VkSparseImageFormatFlags flags; +} VkSparseImageFormatProperties; + +typedef struct VkSparseImageMemoryBind +{ + VkImageSubresource subresource; + VkOffset3D offset; + VkExtent3D extent; + VkDeviceMemory WINE_VK_ALIGN(8) memory; + VkDeviceSize WINE_VK_ALIGN(8) memoryOffset; + VkSparseMemoryBindFlags flags; +} VkSparseImageMemoryBind; + +typedef struct VkSparseImageMemoryRequirements +{ + VkSparseImageFormatProperties formatProperties; + uint32_t imageMipTailFirstLod; + VkDeviceSize WINE_VK_ALIGN(8) imageMipTailSize; + VkDeviceSize WINE_VK_ALIGN(8) imageMipTailOffset; + VkDeviceSize WINE_VK_ALIGN(8) imageMipTailStride; +} VkSparseImageMemoryRequirements; + +typedef struct VkSparseMemoryBind +{ + VkDeviceSize WINE_VK_ALIGN(8) resourceOffset; + VkDeviceSize WINE_VK_ALIGN(8) size; + VkDeviceMemory WINE_VK_ALIGN(8) memory; + VkDeviceSize WINE_VK_ALIGN(8) memoryOffset; + VkSparseMemoryBindFlags flags; +} VkSparseMemoryBind; + +typedef struct VkSpecializationMapEntry +{ + uint32_t constantID; + uint32_t offset; + size_t size; +} VkSpecializationMapEntry; + +typedef struct VkSubmitInfo +{ + VkStructureType sType; + const void *pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore *pWaitSemaphores; + const VkPipelineStageFlags *pWaitDstStageMask; + uint32_t commandBufferCount; + const VkCommandBuffer *pCommandBuffers; + uint32_t signalSemaphoreCount; + const VkSemaphore *pSignalSemaphores; +} VkSubmitInfo; + +typedef struct VkSubresourceLayout +{ + VkDeviceSize WINE_VK_ALIGN(8) offset; + VkDeviceSize WINE_VK_ALIGN(8) size; + VkDeviceSize WINE_VK_ALIGN(8) rowPitch; + VkDeviceSize WINE_VK_ALIGN(8) arrayPitch; + VkDeviceSize WINE_VK_ALIGN(8) depthPitch; +} VkSubresourceLayout; + +typedef struct VkVertexInputAttributeDescription +{ + uint32_t location; + uint32_t binding; + VkFormat format; + uint32_t offset; +} VkVertexInputAttributeDescription; + +typedef struct VkXYColorEXT +{ + float x; + float y; +} VkXYColorEXT; + +typedef struct VkAllocationCallbacks +{ + void *pUserData; + PFN_vkAllocationFunction pfnAllocation; + PFN_vkReallocationFunction pfnReallocation; + PFN_vkFreeFunction pfnFree; + PFN_vkInternalAllocationNotification pfnInternalAllocation; + PFN_vkInternalFreeNotification pfnInternalFree; +} VkAllocationCallbacks; + +typedef struct VkAttachmentReference +{ + uint32_t attachment; + VkImageLayout layout; +} VkAttachmentReference; + +typedef struct VkBufferCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkBufferCreateFlags flags; + VkDeviceSize WINE_VK_ALIGN(8) size; + VkBufferUsageFlags usage; + VkSharingMode sharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t *pQueueFamilyIndices; +} VkBufferCreateInfo; + +typedef struct VkBufferViewCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkBufferViewCreateFlags flags; + VkBuffer WINE_VK_ALIGN(8) buffer; + VkFormat format; + VkDeviceSize WINE_VK_ALIGN(8) offset; + VkDeviceSize WINE_VK_ALIGN(8) range; +} VkBufferViewCreateInfo; + +typedef struct VkClearDepthStencilValue +{ + float depth; + uint32_t stencil; +} VkClearDepthStencilValue; + +typedef union VkClearValue +{ + VkClearColorValue color; + VkClearDepthStencilValue depthStencil; +} VkClearValue; + +typedef struct VkCommandBufferBeginInfo +{ + VkStructureType sType; + const void *pNext; + VkCommandBufferUsageFlags flags; + const VkCommandBufferInheritanceInfo *pInheritanceInfo; +} VkCommandBufferBeginInfo; + +typedef struct VkDescriptorBufferInfo +{ + VkBuffer WINE_VK_ALIGN(8) buffer; + VkDeviceSize WINE_VK_ALIGN(8) offset; + VkDeviceSize WINE_VK_ALIGN(8) range; +} VkDescriptorBufferInfo; + +typedef struct VkDescriptorSetAllocateInfo +{ + VkStructureType sType; + const void *pNext; + VkDescriptorPool WINE_VK_ALIGN(8) descriptorPool; + uint32_t descriptorSetCount; + const VkDescriptorSetLayout *pSetLayouts; +} VkDescriptorSetAllocateInfo; + +typedef struct VkDescriptorUpdateTemplateCreateInfoKHR +{ + VkStructureType sType; + void *pNext; + VkDescriptorUpdateTemplateCreateFlagsKHR flags; + uint32_t descriptorUpdateEntryCount; + const VkDescriptorUpdateTemplateEntryKHR *pDescriptorUpdateEntries; + VkDescriptorUpdateTemplateTypeKHR templateType; + VkDescriptorSetLayout WINE_VK_ALIGN(8) descriptorSetLayout; + VkPipelineBindPoint pipelineBindPoint; + VkPipelineLayout WINE_VK_ALIGN(8) pipelineLayout; + uint32_t set; +} VkDescriptorUpdateTemplateCreateInfoKHR; + +typedef struct VkEventCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkEventCreateFlags flags; +} VkEventCreateInfo; + +typedef struct VkExtent2D +{ + uint32_t width; + uint32_t height; +} VkExtent2D; + +typedef struct VkFormatProperties2KHR +{ + VkStructureType sType; + void *pNext; + VkFormatProperties formatProperties; +} VkFormatProperties2KHR; + +typedef struct VkHdrMetadataEXT +{ + VkStructureType sType; + const void *pNext; + VkXYColorEXT displayPrimaryRed; + VkXYColorEXT displayPrimaryGreen; + VkXYColorEXT displayPrimaryBlue; + VkXYColorEXT whitePoint; + float maxLuminance; + float minLuminance; + float maxContentLightLevel; + float maxFrameAverageLightLevel; +} VkHdrMetadataEXT; + +typedef struct VkImageFormatProperties +{ + VkExtent3D maxExtent; + uint32_t maxMipLevels; + uint32_t maxArrayLayers; + VkSampleCountFlags sampleCounts; + VkDeviceSize WINE_VK_ALIGN(8) maxResourceSize; +} VkImageFormatProperties; + +typedef struct VkImageMemoryBarrier +{ + VkStructureType sType; + const void *pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + VkImageLayout oldLayout; + VkImageLayout newLayout; + uint32_t srcQueueFamilyIndex; + uint32_t dstQueueFamilyIndex; + VkImage WINE_VK_ALIGN(8) image; + VkImageSubresourceRange subresourceRange; +} VkImageMemoryBarrier; + +typedef struct VkImageSubresourceLayers +{ + VkImageAspectFlags aspectMask; + uint32_t mipLevel; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkImageSubresourceLayers; + +typedef struct VkMemoryBarrier +{ + VkStructureType sType; + const void *pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; +} VkMemoryBarrier; + +typedef struct VkMemoryType +{ + VkMemoryPropertyFlags propertyFlags; + uint32_t heapIndex; +} VkMemoryType; + +typedef struct VkPhysicalDeviceSparseImageFormatInfo2KHR +{ + VkStructureType sType; + const void *pNext; + VkFormat format; + VkImageType type; + VkSampleCountFlagBits samples; + VkImageUsageFlags usage; + VkImageTiling tiling; +} VkPhysicalDeviceSparseImageFormatInfo2KHR; + +typedef struct VkPipelineColorBlendAttachmentState +{ + VkBool32 blendEnable; + VkBlendFactor srcColorBlendFactor; + VkBlendFactor dstColorBlendFactor; + VkBlendOp colorBlendOp; + VkBlendFactor srcAlphaBlendFactor; + VkBlendFactor dstAlphaBlendFactor; + VkBlendOp alphaBlendOp; + VkColorComponentFlags colorWriteMask; +} VkPipelineColorBlendAttachmentState; + +typedef struct VkPipelineDynamicStateCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineDynamicStateCreateFlags flags; + uint32_t dynamicStateCount; + const VkDynamicState *pDynamicStates; +} VkPipelineDynamicStateCreateInfo; + +typedef struct VkPipelineRasterizationStateCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineRasterizationStateCreateFlags flags; + VkBool32 depthClampEnable; + VkBool32 rasterizerDiscardEnable; + VkPolygonMode polygonMode; + VkCullModeFlags cullMode; + VkFrontFace frontFace; + VkBool32 depthBiasEnable; + float depthBiasConstantFactor; + float depthBiasClamp; + float depthBiasSlopeFactor; + float lineWidth; +} VkPipelineRasterizationStateCreateInfo; + +typedef struct VkQueueFamilyProperties +{ + VkQueueFlags queueFlags; + uint32_t queueCount; + uint32_t timestampValidBits; + VkExtent3D minImageTransferGranularity; +} VkQueueFamilyProperties; + +typedef struct VkSamplerCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkSamplerCreateFlags flags; + VkFilter magFilter; + VkFilter minFilter; + VkSamplerMipmapMode mipmapMode; + VkSamplerAddressMode addressModeU; + VkSamplerAddressMode addressModeV; + VkSamplerAddressMode addressModeW; + float mipLodBias; + VkBool32 anisotropyEnable; + float maxAnisotropy; + VkBool32 compareEnable; + VkCompareOp compareOp; + float minLod; + float maxLod; + VkBorderColor borderColor; + VkBool32 unnormalizedCoordinates; +} VkSamplerCreateInfo; + +typedef struct VkSparseBufferMemoryBindInfo +{ + VkBuffer WINE_VK_ALIGN(8) buffer; + uint32_t bindCount; + const VkSparseMemoryBind *pBinds; +} VkSparseBufferMemoryBindInfo; + +typedef struct VkSparseImageMemoryBindInfo +{ + VkImage WINE_VK_ALIGN(8) image; + uint32_t bindCount; + const VkSparseImageMemoryBind *pBinds; +} VkSparseImageMemoryBindInfo; + +typedef struct VkSpecializationInfo +{ + uint32_t mapEntryCount; + const VkSpecializationMapEntry *pMapEntries; + size_t dataSize; + const void *pData; +} VkSpecializationInfo; + +typedef struct VkSubpassDependency +{ + uint32_t srcSubpass; + uint32_t dstSubpass; + VkPipelineStageFlags srcStageMask; + VkPipelineStageFlags dstStageMask; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + VkDependencyFlags dependencyFlags; +} VkSubpassDependency; + +typedef struct VkSurfaceFormatKHR +{ + VkFormat format; + VkColorSpaceKHR colorSpace; +} VkSurfaceFormatKHR; + +typedef struct VkViewport +{ + float x; + float y; + float width; + float height; + float minDepth; + float maxDepth; +} VkViewport; + +typedef struct VkWriteDescriptorSet +{ + VkStructureType sType; + const void *pNext; + VkDescriptorSet WINE_VK_ALIGN(8) dstSet; + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + VkDescriptorType descriptorType; + const VkDescriptorImageInfo *pImageInfo; + const VkDescriptorBufferInfo *pBufferInfo; + const VkBufferView *pTexelBufferView; +} VkWriteDescriptorSet; + +typedef struct VkApplicationInfo +{ + VkStructureType sType; + const void *pNext; + const char *pApplicationName; + uint32_t applicationVersion; + const char *pEngineName; + uint32_t engineVersion; + uint32_t apiVersion; +} VkApplicationInfo; + +typedef struct VkBufferImageCopy +{ + VkDeviceSize WINE_VK_ALIGN(8) bufferOffset; + uint32_t bufferRowLength; + uint32_t bufferImageHeight; + VkImageSubresourceLayers imageSubresource; + VkOffset3D imageOffset; + VkExtent3D imageExtent; +} VkBufferImageCopy; + +typedef struct VkDescriptorPoolCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkDescriptorPoolCreateFlags flags; + uint32_t maxSets; + uint32_t poolSizeCount; + const VkDescriptorPoolSize *pPoolSizes; +} VkDescriptorPoolCreateInfo; + +typedef struct VkDeviceQueueCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkDeviceQueueCreateFlags flags; + uint32_t queueFamilyIndex; + uint32_t queueCount; + const float *pQueuePriorities; +} VkDeviceQueueCreateInfo; + +typedef struct VkFenceCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkFenceCreateFlags flags; +} VkFenceCreateInfo; + +typedef struct VkImageBlit +{ + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffsets[2]; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffsets[2]; +} VkImageBlit; + +typedef struct VkImageFormatProperties2KHR +{ + VkStructureType sType; + void *pNext; + VkImageFormatProperties WINE_VK_ALIGN(8) imageFormatProperties; +} VkImageFormatProperties2KHR; + +typedef struct VkOffset2D +{ + int32_t x; + int32_t y; +} VkOffset2D; + +typedef struct VkPhysicalDeviceFeatures2KHR +{ + VkStructureType sType; + void *pNext; + VkPhysicalDeviceFeatures features; +} VkPhysicalDeviceFeatures2KHR; + +typedef struct VkPipelineShaderStageCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineShaderStageCreateFlags flags; + VkShaderStageFlagBits stage; + VkShaderModule WINE_VK_ALIGN(8) module; + const char *pName; + const VkSpecializationInfo *pSpecializationInfo; +} VkPipelineShaderStageCreateInfo; + +typedef struct VkQueueFamilyProperties2KHR +{ + VkStructureType sType; + void *pNext; + VkQueueFamilyProperties queueFamilyProperties; +} VkQueueFamilyProperties2KHR; + +typedef struct VkShaderModuleCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkShaderModuleCreateFlags flags; + size_t codeSize; + const uint32_t *pCode; +} VkShaderModuleCreateInfo; + +typedef struct VkSparseImageOpaqueMemoryBindInfo +{ + VkImage WINE_VK_ALIGN(8) image; + uint32_t bindCount; + const VkSparseMemoryBind *pBinds; +} VkSparseImageOpaqueMemoryBindInfo; + +typedef struct VkSubpassDescription +{ + VkSubpassDescriptionFlags flags; + VkPipelineBindPoint pipelineBindPoint; + uint32_t inputAttachmentCount; + const VkAttachmentReference *pInputAttachments; + uint32_t colorAttachmentCount; + const VkAttachmentReference *pColorAttachments; + const VkAttachmentReference *pResolveAttachments; + const VkAttachmentReference *pDepthStencilAttachment; + uint32_t preserveAttachmentCount; + const uint32_t *pPreserveAttachments; +} VkSubpassDescription; + +typedef struct VkSwapchainCreateInfoKHR +{ + VkStructureType sType; + const void *pNext; + VkSwapchainCreateFlagsKHR flags; + VkSurfaceKHR WINE_VK_ALIGN(8) surface; + uint32_t minImageCount; + VkFormat imageFormat; + VkColorSpaceKHR imageColorSpace; + VkExtent2D imageExtent; + uint32_t imageArrayLayers; + VkImageUsageFlags imageUsage; + VkSharingMode imageSharingMode; + uint32_t queueFamilyIndexCount; + const uint32_t *pQueueFamilyIndices; + VkSurfaceTransformFlagBitsKHR preTransform; + VkCompositeAlphaFlagBitsKHR compositeAlpha; + VkPresentModeKHR presentMode; + VkBool32 clipped; + VkSwapchainKHR WINE_VK_ALIGN(8) oldSwapchain; +} VkSwapchainCreateInfoKHR; + +typedef struct VkViewportWScalingNV +{ + float xcoeff; + float ycoeff; +} VkViewportWScalingNV; + +typedef struct VkClearAttachment +{ + VkImageAspectFlags aspectMask; + uint32_t colorAttachment; + VkClearValue clearValue; +} VkClearAttachment; + +typedef struct VkCommandPoolCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkCommandPoolCreateFlags flags; + uint32_t queueFamilyIndex; +} VkCommandPoolCreateInfo; + +typedef struct VkDeviceCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkDeviceCreateFlags flags; + uint32_t queueCreateInfoCount; + const VkDeviceQueueCreateInfo *pQueueCreateInfos; + uint32_t enabledLayerCount; + const char * const*ppEnabledLayerNames; + uint32_t enabledExtensionCount; + const char * const*ppEnabledExtensionNames; + const VkPhysicalDeviceFeatures *pEnabledFeatures; +} VkDeviceCreateInfo; + +typedef struct VkImageCopy +{ + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffset; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffset; + VkExtent3D extent; +} VkImageCopy; + +typedef struct VkMemoryHeap +{ + VkDeviceSize WINE_VK_ALIGN(8) size; + VkMemoryHeapFlags flags; +} VkMemoryHeap; + +typedef struct VkPhysicalDeviceMemoryProperties +{ + uint32_t memoryTypeCount; + VkMemoryType memoryTypes[VK_MAX_MEMORY_TYPES]; + uint32_t memoryHeapCount; + VkMemoryHeap WINE_VK_ALIGN(8) memoryHeaps[VK_MAX_MEMORY_HEAPS]; +} VkPhysicalDeviceMemoryProperties; + +typedef struct VkPipelineColorBlendStateCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineColorBlendStateCreateFlags flags; + VkBool32 logicOpEnable; + VkLogicOp logicOp; + uint32_t attachmentCount; + const VkPipelineColorBlendAttachmentState *pAttachments; + float blendConstants[4]; +} VkPipelineColorBlendStateCreateInfo; + +typedef struct VkPushConstantRange +{ + VkShaderStageFlags stageFlags; + uint32_t offset; + uint32_t size; +} VkPushConstantRange; + +typedef struct VkRenderPassCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkRenderPassCreateFlags flags; + uint32_t attachmentCount; + const VkAttachmentDescription *pAttachments; + uint32_t subpassCount; + const VkSubpassDescription *pSubpasses; + uint32_t dependencyCount; + const VkSubpassDependency *pDependencies; +} VkRenderPassCreateInfo; + +typedef struct VkStencilOpState +{ + VkStencilOp failOp; + VkStencilOp passOp; + VkStencilOp depthFailOp; + VkCompareOp compareOp; + uint32_t compareMask; + uint32_t writeMask; + uint32_t reference; +} VkStencilOpState; + +typedef struct VkVertexInputBindingDescription +{ + uint32_t binding; + uint32_t stride; + VkVertexInputRate inputRate; +} VkVertexInputBindingDescription; + +typedef struct VkBindSparseInfo +{ + VkStructureType sType; + const void *pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore *pWaitSemaphores; + uint32_t bufferBindCount; + const VkSparseBufferMemoryBindInfo *pBufferBinds; + uint32_t imageOpaqueBindCount; + const VkSparseImageOpaqueMemoryBindInfo *pImageOpaqueBinds; + uint32_t imageBindCount; + const VkSparseImageMemoryBindInfo *pImageBinds; + uint32_t signalSemaphoreCount; + const VkSemaphore *pSignalSemaphores; +} VkBindSparseInfo; + +typedef struct VkComputePipelineCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineCreateFlags flags; + VkPipelineShaderStageCreateInfo WINE_VK_ALIGN(8) stage; + VkPipelineLayout WINE_VK_ALIGN(8) layout; + VkPipeline WINE_VK_ALIGN(8) basePipelineHandle; + int32_t basePipelineIndex; +} VkComputePipelineCreateInfo; + +typedef struct VkImageResolve +{ + VkImageSubresourceLayers srcSubresource; + VkOffset3D srcOffset; + VkImageSubresourceLayers dstSubresource; + VkOffset3D dstOffset; + VkExtent3D extent; +} VkImageResolve; + +typedef struct VkPhysicalDeviceMemoryProperties2KHR +{ + VkStructureType sType; + void *pNext; + VkPhysicalDeviceMemoryProperties WINE_VK_ALIGN(8) memoryProperties; +} VkPhysicalDeviceMemoryProperties2KHR; + +typedef struct VkPipelineDepthStencilStateCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineDepthStencilStateCreateFlags flags; + VkBool32 depthTestEnable; + VkBool32 depthWriteEnable; + VkCompareOp depthCompareOp; + VkBool32 depthBoundsTestEnable; + VkBool32 stencilTestEnable; + VkStencilOpState front; + VkStencilOpState back; + float minDepthBounds; + float maxDepthBounds; +} VkPipelineDepthStencilStateCreateInfo; + +typedef struct VkPipelineVertexInputStateCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineVertexInputStateCreateFlags flags; + uint32_t vertexBindingDescriptionCount; + const VkVertexInputBindingDescription *pVertexBindingDescriptions; + uint32_t vertexAttributeDescriptionCount; + const VkVertexInputAttributeDescription *pVertexAttributeDescriptions; +} VkPipelineVertexInputStateCreateInfo; + +typedef struct VkRect2D +{ + VkOffset2D offset; + VkExtent2D extent; +} VkRect2D; + +typedef struct VkSparseImageFormatProperties2KHR +{ + VkStructureType sType; + void *pNext; + VkSparseImageFormatProperties properties; +} VkSparseImageFormatProperties2KHR; + +typedef struct VkWin32SurfaceCreateInfoKHR +{ + VkStructureType sType; + const void *pNext; + VkWin32SurfaceCreateFlagsKHR flags; + HINSTANCE hinstance; + HWND hwnd; +} VkWin32SurfaceCreateInfoKHR; + +typedef struct VkClearRect +{ + VkRect2D rect; + uint32_t baseArrayLayer; + uint32_t layerCount; +} VkClearRect; + +typedef struct VkDrawIndexedIndirectCommand +{ + uint32_t indexCount; + uint32_t instanceCount; + uint32_t firstIndex; + int32_t vertexOffset; + uint32_t firstInstance; +} VkDrawIndexedIndirectCommand; + +typedef struct VkInstanceCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkInstanceCreateFlags flags; + const VkApplicationInfo *pApplicationInfo; + uint32_t enabledLayerCount; + const char * const*ppEnabledLayerNames; + uint32_t enabledExtensionCount; + const char * const*ppEnabledExtensionNames; +} VkInstanceCreateInfo; + +typedef struct VkPipelineLayoutCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineLayoutCreateFlags flags; + uint32_t setLayoutCount; + const VkDescriptorSetLayout *pSetLayouts; + uint32_t pushConstantRangeCount; + const VkPushConstantRange *pPushConstantRanges; +} VkPipelineLayoutCreateInfo; + +typedef struct VkRenderPassBeginInfo +{ + VkStructureType sType; + const void *pNext; + VkRenderPass WINE_VK_ALIGN(8) renderPass; + VkFramebuffer WINE_VK_ALIGN(8) framebuffer; + VkRect2D renderArea; + uint32_t clearValueCount; + const VkClearValue *pClearValues; +} VkRenderPassBeginInfo; + +typedef struct VkDescriptorSetLayoutCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkDescriptorSetLayoutCreateFlags flags; + uint32_t bindingCount; + const VkDescriptorSetLayoutBinding *pBindings; +} VkDescriptorSetLayoutCreateInfo; + +typedef struct VkPhysicalDeviceLimits +{ + uint32_t maxImageDimension1D; + uint32_t maxImageDimension2D; + uint32_t maxImageDimension3D; + uint32_t maxImageDimensionCube; + uint32_t maxImageArrayLayers; + uint32_t maxTexelBufferElements; + uint32_t maxUniformBufferRange; + uint32_t maxStorageBufferRange; + uint32_t maxPushConstantsSize; + uint32_t maxMemoryAllocationCount; + uint32_t maxSamplerAllocationCount; + VkDeviceSize WINE_VK_ALIGN(8) bufferImageGranularity; + VkDeviceSize WINE_VK_ALIGN(8) sparseAddressSpaceSize; + uint32_t maxBoundDescriptorSets; + uint32_t maxPerStageDescriptorSamplers; + uint32_t maxPerStageDescriptorUniformBuffers; + uint32_t maxPerStageDescriptorStorageBuffers; + uint32_t maxPerStageDescriptorSampledImages; + uint32_t maxPerStageDescriptorStorageImages; + uint32_t maxPerStageDescriptorInputAttachments; + uint32_t maxPerStageResources; + uint32_t maxDescriptorSetSamplers; + uint32_t maxDescriptorSetUniformBuffers; + uint32_t maxDescriptorSetUniformBuffersDynamic; + uint32_t maxDescriptorSetStorageBuffers; + uint32_t maxDescriptorSetStorageBuffersDynamic; + uint32_t maxDescriptorSetSampledImages; + uint32_t maxDescriptorSetStorageImages; + uint32_t maxDescriptorSetInputAttachments; + uint32_t maxVertexInputAttributes; + uint32_t maxVertexInputBindings; + uint32_t maxVertexInputAttributeOffset; + uint32_t maxVertexInputBindingStride; + uint32_t maxVertexOutputComponents; + uint32_t maxTessellationGenerationLevel; + uint32_t maxTessellationPatchSize; + uint32_t maxTessellationControlPerVertexInputComponents; + uint32_t maxTessellationControlPerVertexOutputComponents; + uint32_t maxTessellationControlPerPatchOutputComponents; + uint32_t maxTessellationControlTotalOutputComponents; + uint32_t maxTessellationEvaluationInputComponents; + uint32_t maxTessellationEvaluationOutputComponents; + uint32_t maxGeometryShaderInvocations; + uint32_t maxGeometryInputComponents; + uint32_t maxGeometryOutputComponents; + uint32_t maxGeometryOutputVertices; + uint32_t maxGeometryTotalOutputComponents; + uint32_t maxFragmentInputComponents; + uint32_t maxFragmentOutputAttachments; + uint32_t maxFragmentDualSrcAttachments; + uint32_t maxFragmentCombinedOutputResources; + uint32_t maxComputeSharedMemorySize; + uint32_t maxComputeWorkGroupCount[3]; + uint32_t maxComputeWorkGroupInvocations; + uint32_t maxComputeWorkGroupSize[3]; + uint32_t subPixelPrecisionBits; + uint32_t subTexelPrecisionBits; + uint32_t mipmapPrecisionBits; + uint32_t maxDrawIndexedIndexValue; + uint32_t maxDrawIndirectCount; + float maxSamplerLodBias; + float maxSamplerAnisotropy; + uint32_t maxViewports; + uint32_t maxViewportDimensions[2]; + float viewportBoundsRange[2]; + uint32_t viewportSubPixelBits; + size_t minMemoryMapAlignment; + VkDeviceSize WINE_VK_ALIGN(8) minTexelBufferOffsetAlignment; + VkDeviceSize WINE_VK_ALIGN(8) minUniformBufferOffsetAlignment; + VkDeviceSize WINE_VK_ALIGN(8) minStorageBufferOffsetAlignment; + int32_t minTexelOffset; + uint32_t maxTexelOffset; + int32_t minTexelGatherOffset; + uint32_t maxTexelGatherOffset; + float minInterpolationOffset; + float maxInterpolationOffset; + uint32_t subPixelInterpolationOffsetBits; + uint32_t maxFramebufferWidth; + uint32_t maxFramebufferHeight; + uint32_t maxFramebufferLayers; + VkSampleCountFlags framebufferColorSampleCounts; + VkSampleCountFlags framebufferDepthSampleCounts; + VkSampleCountFlags framebufferStencilSampleCounts; + VkSampleCountFlags framebufferNoAttachmentsSampleCounts; + uint32_t maxColorAttachments; + VkSampleCountFlags sampledImageColorSampleCounts; + VkSampleCountFlags sampledImageIntegerSampleCounts; + VkSampleCountFlags sampledImageDepthSampleCounts; + VkSampleCountFlags sampledImageStencilSampleCounts; + VkSampleCountFlags storageImageSampleCounts; + uint32_t maxSampleMaskWords; + VkBool32 timestampComputeAndGraphics; + float timestampPeriod; + uint32_t maxClipDistances; + uint32_t maxCullDistances; + uint32_t maxCombinedClipAndCullDistances; + uint32_t discreteQueuePriorities; + float pointSizeRange[2]; + float lineWidthRange[2]; + float pointSizeGranularity; + float lineWidthGranularity; + VkBool32 strictLines; + VkBool32 standardSampleLocations; + VkDeviceSize WINE_VK_ALIGN(8) optimalBufferCopyOffsetAlignment; + VkDeviceSize WINE_VK_ALIGN(8) optimalBufferCopyRowPitchAlignment; + VkDeviceSize WINE_VK_ALIGN(8) nonCoherentAtomSize; +} VkPhysicalDeviceLimits; + +typedef struct VkPipelineViewportStateCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineViewportStateCreateFlags flags; + uint32_t viewportCount; + const VkViewport *pViewports; + uint32_t scissorCount; + const VkRect2D *pScissors; +} VkPipelineViewportStateCreateInfo; + +typedef struct VkGraphicsPipelineCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineCreateFlags flags; + uint32_t stageCount; + const VkPipelineShaderStageCreateInfo *pStages; + const VkPipelineVertexInputStateCreateInfo *pVertexInputState; + const VkPipelineInputAssemblyStateCreateInfo *pInputAssemblyState; + const VkPipelineTessellationStateCreateInfo *pTessellationState; + const VkPipelineViewportStateCreateInfo *pViewportState; + const VkPipelineRasterizationStateCreateInfo *pRasterizationState; + const VkPipelineMultisampleStateCreateInfo *pMultisampleState; + const VkPipelineDepthStencilStateCreateInfo *pDepthStencilState; + const VkPipelineColorBlendStateCreateInfo *pColorBlendState; + const VkPipelineDynamicStateCreateInfo *pDynamicState; + VkPipelineLayout WINE_VK_ALIGN(8) layout; + VkRenderPass WINE_VK_ALIGN(8) renderPass; + uint32_t subpass; + VkPipeline WINE_VK_ALIGN(8) basePipelineHandle; + int32_t basePipelineIndex; +} VkGraphicsPipelineCreateInfo; + +typedef struct VkSurfaceCapabilitiesKHR +{ + uint32_t minImageCount; + uint32_t maxImageCount; + VkExtent2D currentExtent; + VkExtent2D minImageExtent; + VkExtent2D maxImageExtent; + uint32_t maxImageArrayLayers; + VkSurfaceTransformFlagsKHR supportedTransforms; + VkSurfaceTransformFlagBitsKHR currentTransform; + VkCompositeAlphaFlagsKHR supportedCompositeAlpha; + VkImageUsageFlags supportedUsageFlags; +} VkSurfaceCapabilitiesKHR; + +typedef struct VkPhysicalDeviceProperties +{ + uint32_t apiVersion; + uint32_t driverVersion; + uint32_t vendorID; + uint32_t deviceID; + VkPhysicalDeviceType deviceType; + char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; + uint8_t pipelineCacheUUID[VK_UUID_SIZE]; + VkPhysicalDeviceLimits WINE_VK_ALIGN(8) limits; + VkPhysicalDeviceSparseProperties sparseProperties; +} VkPhysicalDeviceProperties; + +typedef struct VkPhysicalDeviceProperties2KHR +{ + VkStructureType sType; + void *pNext; + VkPhysicalDeviceProperties WINE_VK_ALIGN(8) properties; +} VkPhysicalDeviceProperties2KHR; + +VkResult VKAPI_CALL vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex); +VkResult VKAPI_CALL vkAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, VkCommandBuffer *pCommandBuffers); +VkResult VKAPI_CALL vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo, VkDescriptorSet *pDescriptorSets); +VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory); +VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo); +VkResult VKAPI_CALL vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset); +VkResult VKAPI_CALL vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset); +void VKAPI_CALL vkCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags); +void VKAPI_CALL vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, VkSubpassContents contents); +void VKAPI_CALL vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet *pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t *pDynamicOffsets); +void VKAPI_CALL vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType); +void VKAPI_CALL vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); +void VKAPI_CALL vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets); +void VKAPI_CALL vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit *pRegions, VkFilter filter); +void VKAPI_CALL vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment *pAttachments, uint32_t rectCount, const VkClearRect *pRects); +void VKAPI_CALL vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue *pColor, uint32_t rangeCount, const VkImageSubresourceRange *pRanges); +void VKAPI_CALL vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue *pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange *pRanges); +void VKAPI_CALL vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy *pRegions); +void VKAPI_CALL vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy *pRegions); +void VKAPI_CALL vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy *pRegions); +void VKAPI_CALL vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy *pRegions); +void VKAPI_CALL vkCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags); +void VKAPI_CALL vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); +void VKAPI_CALL vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); +void VKAPI_CALL vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); +void VKAPI_CALL vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); +void VKAPI_CALL vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); +void VKAPI_CALL vkCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); +void VKAPI_CALL vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); +void VKAPI_CALL vkCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); +void VKAPI_CALL vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query); +void VKAPI_CALL vkCmdEndRenderPass(VkCommandBuffer commandBuffer); +void VKAPI_CALL vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers); +void VKAPI_CALL vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data); +void VKAPI_CALL vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents); +void VKAPI_CALL vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers); +void VKAPI_CALL vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void *pValues); +void VKAPI_CALL vkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites); +void VKAPI_CALL vkCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void *pData); +void VKAPI_CALL vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); +void VKAPI_CALL vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); +void VKAPI_CALL vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve *pRegions); +void VKAPI_CALL vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]); +void VKAPI_CALL vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor); +void VKAPI_CALL vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds); +void VKAPI_CALL vkCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D *pDiscardRectangles); +void VKAPI_CALL vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); +void VKAPI_CALL vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth); +void VKAPI_CALL vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D *pScissors); +void VKAPI_CALL vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask); +void VKAPI_CALL vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference); +void VKAPI_CALL vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask); +void VKAPI_CALL vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport *pViewports); +void VKAPI_CALL vkCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV *pViewportWScalings); +void VKAPI_CALL vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void *pData); +void VKAPI_CALL vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers); +void VKAPI_CALL vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query); +VkResult VKAPI_CALL vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer); +VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBufferView *pView); +VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCommandPool *pCommandPool); +VkResult VKAPI_CALL vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines); +VkResult VKAPI_CALL vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorPool *pDescriptorPool); +VkResult VKAPI_CALL vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorSetLayout *pSetLayout); +VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorUpdateTemplateKHR *pDescriptorUpdateTemplate); +VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDevice *pDevice); +VkResult VKAPI_CALL vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkEvent *pEvent); +VkResult VKAPI_CALL vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFence *pFence); +VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFramebuffer *pFramebuffer); +VkResult VKAPI_CALL vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines); +VkResult VKAPI_CALL vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage); +VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImageView *pView); +VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkInstance *pInstance); +VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineCache *pPipelineCache); +VkResult VKAPI_CALL vkCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineLayout *pPipelineLayout); +VkResult VKAPI_CALL vkCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool); +VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass); +VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSampler *pSampler); +VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore); +VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkShaderModule *pShaderModule); +VkResult VKAPI_CALL vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain); +VkResult VKAPI_CALL vkCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); +void VKAPI_CALL vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks *pAllocator); +VkResult VKAPI_CALL vkDeviceWaitIdle(VkDevice device); +VkResult VKAPI_CALL vkEndCommandBuffer(VkCommandBuffer commandBuffer); +VkResult VKAPI_CALL vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties); +VkResult VKAPI_CALL vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkLayerProperties *pProperties); +VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties); +VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t *pPropertyCount, VkLayerProperties *pProperties); +VkResult VKAPI_CALL vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices); +VkResult VKAPI_CALL vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges); +void VKAPI_CALL vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers); +VkResult VKAPI_CALL vkFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet *pDescriptorSets); +void VKAPI_CALL vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements *pMemoryRequirements); +void VKAPI_CALL vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize *pCommittedMemoryInBytes); +PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char *pName); +void VKAPI_CALL vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue); +VkResult VKAPI_CALL vkGetEventStatus(VkDevice device, VkEvent event); +VkResult VKAPI_CALL vkGetFenceStatus(VkDevice device, VkFence fence); +void VKAPI_CALL vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements *pMemoryRequirements); +void VKAPI_CALL vkGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements *pSparseMemoryRequirements); +void VKAPI_CALL vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource *pSubresource, VkSubresourceLayout *pLayout); +PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *pName); +void VKAPI_CALL vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures); +void VKAPI_CALL vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2KHR *pFeatures); +void VKAPI_CALL vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatProperties); +void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2KHR *pFormatProperties); +VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties); +VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, VkImageFormatProperties2KHR *pImageFormatProperties); +void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties *pMemoryProperties); +void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2KHR *pMemoryProperties); +void VKAPI_CALL vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties); +void VKAPI_CALL vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2KHR *pProperties); +void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties *pQueueFamilyProperties); +void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2KHR *pQueueFamilyProperties); +void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t *pPropertyCount, VkSparseImageFormatProperties *pProperties); +void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, uint32_t *pPropertyCount, VkSparseImageFormatProperties2KHR *pProperties); +VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities); +VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats); +VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes); +VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32 *pSupported); +VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex); +VkResult VKAPI_CALL vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t *pDataSize, void *pData); +VkResult VKAPI_CALL vkGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void *pData, VkDeviceSize stride, VkQueryResultFlags flags); +void VKAPI_CALL vkGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D *pGranularity); +VkResult VKAPI_CALL vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount, VkImage *pSwapchainImages); +VkResult VKAPI_CALL vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges); +VkResult VKAPI_CALL vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void **ppData); +VkResult VKAPI_CALL vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache *pSrcCaches); +VkResult VKAPI_CALL vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo *pBindInfo, VkFence fence); +VkResult VKAPI_CALL vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo); +VkResult VKAPI_CALL vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence); +VkResult VKAPI_CALL vkQueueWaitIdle(VkQueue queue); +VkResult VKAPI_CALL vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags); +VkResult VKAPI_CALL vkResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags); +VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags); +VkResult VKAPI_CALL vkResetEvent(VkDevice device, VkEvent event); +VkResult VKAPI_CALL vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences); +VkResult VKAPI_CALL vkSetEvent(VkDevice device, VkEvent event); +void VKAPI_CALL vkSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR *pSwapchains, const VkHdrMetadataEXT *pMetadata); +void VKAPI_CALL vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlagsKHR flags); +void VKAPI_CALL vkUnmapMemory(VkDevice device, VkDeviceMemory memory); +void VKAPI_CALL vkUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void *pData); +void VKAPI_CALL vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet *pDescriptorCopies); +VkResult VKAPI_CALL vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences, VkBool32 waitAll, uint64_t timeout); + +#endif /* __WINE_VULKAN_H */
Signed-off-by: Józef Kucia jkucia@codeweavers.com
Roderick Colenbrander thunderbird2k@gmail.com writes:
This file is directly generated from Vulkan's vk.xml. It contains Core and extension Vulkan types and functions.
This would need to include the generating script (ideally in Perl but I can put in a Python script for the time being if needed). I can't commit generated files without a way of re-creating them.
On Fri, Feb 23, 2018 at 5:03 AM, Alexandre Julliard julliard@winehq.org wrote:
Roderick Colenbrander thunderbird2k@gmail.com writes:
This file is directly generated from Vulkan's vk.xml. It contains Core and extension Vulkan types and functions.
This would need to include the generating script (ideally in Perl but I can put in a Python script for the time being if needed). I can't commit generated files without a way of re-creating them.
-- Alexandre Julliard julliard@winehq.org
The current version of the script can be found on my github pag (https://github.com/roderickc/wine-vulkan/blob/master/dlls/winevulkan/vulkan....). It should create the header as you see it now and the rest of the thunks and other code.
I intend to submit it later in the patch series as a lot of other structures and functions in vulkan.c / vulkan_private.h need to be added before the other generate code will be of any use (it can't even get called as the functions can't get loaded by some vk*GetProcAddr). I would like to avoid a lot of dead code basically.
Let me know if that works.
Thanks, Roderick
Roderick Colenbrander thunderbird2k@gmail.com writes:
The current version of the script can be found on my github pag (https://github.com/roderickc/wine-vulkan/blob/master/dlls/winevulkan/vulkan....). It should create the header as you see it now and the rest of the thunks and other code.
I intend to submit it later in the patch series as a lot of other structures and functions in vulkan.c / vulkan_private.h need to be added before the other generate code will be of any use (it can't even get called as the functions can't get loaded by some vk*GetProcAddr). I would like to avoid a lot of dead code basically.
Let me know if that works.
No, the script should be committed along with the code it generates. You can take out the parts that generate stuff that isn't used yet.
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- configure.ac | 1 + dlls/winevulkan/Makefile.in | 6 +++++ dlls/winevulkan/version.rc | 27 +++++++++++++++++++++ dlls/winevulkan/vulkan.c | 54 +++++++++++++++++++++++++++++++++++++++++ dlls/winevulkan/winevulkan.spec | 2 ++ 5 files changed, 90 insertions(+) create mode 100644 dlls/winevulkan/Makefile.in create mode 100644 dlls/winevulkan/version.rc create mode 100644 dlls/winevulkan/vulkan.c create mode 100644 dlls/winevulkan/winevulkan.spec
diff --git a/configure.ac b/configure.ac index d06476e6c9..39c9a4c498 100644 --- a/configure.ac +++ b/configure.ac @@ -3680,6 +3680,7 @@ WINE_CONFIG_DLL(wineps.drv,,[clean]) WINE_CONFIG_DLL(wineps16.drv16,enable_win16) WINE_CONFIG_DLL(winepulse.drv) WINE_CONFIG_DLL(wineqtdecoder) +WINE_CONFIG_DLL(winevulkan) WINE_CONFIG_DLL(winex11.drv) WINE_CONFIG_DLL(wing.dll16,enable_win16) WINE_CONFIG_DLL(wing32) diff --git a/dlls/winevulkan/Makefile.in b/dlls/winevulkan/Makefile.in new file mode 100644 index 0000000000..0bffb487e2 --- /dev/null +++ b/dlls/winevulkan/Makefile.in @@ -0,0 +1,6 @@ +MODULE = winevulkan.dll + +C_SRCS = \ + vulkan.c + +RC_SRCS = version.rc diff --git a/dlls/winevulkan/version.rc b/dlls/winevulkan/version.rc new file mode 100644 index 0000000000..a62ea75a66 --- /dev/null +++ b/dlls/winevulkan/version.rc @@ -0,0 +1,27 @@ +/* + * Copyright 2017 Roderick Colenbrander + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" /* Needed to get PACKAGE_VERSION */ + +#define WINE_FILEDESCRIPTION_STR "Wine Vulkan ICD" +#define WINE_FILENAME_STR "winevulkan.dll" +#define WINE_FILEVERSION_STR PACKAGE_VERSION +#define WINE_PRODUCTVERSION_STR PACKAGE_VERSION +#define WINE_PRODUCTNAME_STR "Wine Vulkan" + +#include "wine/wine_common_ver.rc" diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c new file mode 100644 index 0000000000..ab9c52ee60 --- /dev/null +++ b/dlls/winevulkan/vulkan.c @@ -0,0 +1,54 @@ +/* Wine Vulkan ICD implementation + * + * Copyright 2017 Roderick Colenbrander + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" + +#include "wine/debug.h" +#include "wine/vulkan.h" + +WINE_DEFAULT_DEBUG_CHANNEL(vulkan); + +void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *name) +{ + FIXME("stub: %p %s\n", instance, debugstr_a(name)); + return NULL; +} + +VkResult WINAPI wine_vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t *supported_version) +{ + FIXME("stub: %p\n", pSupportedVersion); + return VK_ERROR_INCOMPATIBLE_DRIVER; +} + +BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) +{ + switch(reason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinst); + break; + + case DLL_THREAD_ATTACH: + break; + } + return TRUE; +} diff --git a/dlls/winevulkan/winevulkan.spec b/dlls/winevulkan/winevulkan.spec new file mode 100644 index 0000000000..c3bccc11f2 --- /dev/null +++ b/dlls/winevulkan/winevulkan.spec @@ -0,0 +1,2 @@ +@ stdcall vk_icdGetInstanceProcAddr(str ptr) wine_vk_icdGetInstanceProcAddr +@ stdcall vk_icdNegotiateLoaderICDInterfaceVersion(ptr) wine_vk_icdNegotiateLoaderICDInterfaceVersion
On Fri, Feb 23, 2018 at 8:22 AM, Roderick Colenbrander thunderbird2k@gmail.com wrote:
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c new file mode 100644 index 0000000000..ab9c52ee60 --- /dev/null +++ b/dlls/winevulkan/vulkan.c @@ -0,0 +1,54 @@ +/* Wine Vulkan ICD implementation
- Copyright 2017 Roderick Colenbrander
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
+#include <stdarg.h>
+#include "windef.h" +#include "winbase.h"
+#include "wine/debug.h" +#include "wine/vulkan.h"
+WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
+void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *name) +{
- FIXME("stub: %p %s\n", instance, debugstr_a(name));
- return NULL;
+}
+VkResult WINAPI wine_vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t *supported_version) +{
- FIXME("stub: %p\n", pSupportedVersion);
The function is now named "supported_version":
../../../wine-git/dlls/winevulkan/vulkan.c: In function wine_vk_icdNegotiateLoaderICDInterfaceVersion: ../../../wine-git/dlls/winevulkan/vulkan.c:38:264: error: pSupportedVersion undeclared (first use in this function) FIXME("stub: %p\n", pSupportedVersion);
- return VK_ERROR_INCOMPATIBLE_DRIVER;
+}
+BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
It's not important but "void *reserved" would be preferred.
+{
- switch(reason)
Please put a space before the switch keyword.
- {
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hinst);
break;
case DLL_THREAD_ATTACH:
break;
- }
- return TRUE;
+} diff --git a/dlls/winevulkan/winevulkan.spec b/dlls/winevulkan/winevulkan.spec new file mode 100644 index 0000000000..c3bccc11f2 --- /dev/null +++ b/dlls/winevulkan/winevulkan.spec @@ -0,0 +1,2 @@ +@ stdcall vk_icdGetInstanceProcAddr(str ptr) wine_vk_icdGetInstanceProcAddr
The spec entry looks wrong to me. It should be vk_icdGetInstanceProcAddr(ptr str).
+@ stdcall vk_icdNegotiateLoaderICDInterfaceVersion(ptr) wine_vk_icdNegotiateLoaderICDInterfaceVersion
2.14.3
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- dlls/winevulkan/vulkan.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index ab9c52ee60..d3daf2a99b 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -27,6 +27,13 @@
WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
+/* For now default to 4 as it felt like a reasonable version feature wise to support. + * Don't support the optional vk_icdGetPhysicalDeviceProcAddr introduced in this version + * as it is unlikely we will implement physical device extensions, which the loader is not + * aware off. Version 5 adds more extensive version checks. Something to tackle later. + */ +#define WINE_VULKAN_ICD_VERSION 4 + void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *name) { FIXME("stub: %p %s\n", instance, debugstr_a(name)); @@ -35,8 +42,20 @@ void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *na
VkResult WINAPI wine_vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t *supported_version) { - FIXME("stub: %p\n", pSupportedVersion); - return VK_ERROR_INCOMPATIBLE_DRIVER; + uint32_t req_version; + TRACE("%p\n", supported_version); + + /* The spec is not clear how to handle this. Mesa drivers don't check, but it + * is probably best to not explode. VK_INCOMPLETE seems to be the closest value. + */ + if (!supported_version) + return VK_INCOMPLETE; + + req_version = *supported_version; + *supported_version = min(req_version, WINE_VULKAN_ICD_VERSION); + TRACE("Loader requested ICD version %u, returning %u\n", req_version, *supported_version); + + return VK_SUCCESS; }
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- dlls/winevulkan/vulkan.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 2 deletions(-)
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index d3daf2a99b..ef2e287646 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -34,12 +34,70 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan); */ #define WINE_VULKAN_ICD_VERSION 4
-void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *name) +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) +#endif + +struct vulkan_func +{ + const char *name; + void *func; +}; + +static void *wine_vk_get_global_proc_addr(const char *name); + +static VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, + VkInstance *pInstance) { - FIXME("stub: %p %s\n", instance, debugstr_a(name)); + FIXME("stub: %p %p %p\n", pCreateInfo, pAllocator, pInstance); + return VK_ERROR_INCOMPATIBLE_DRIVER; +} + +static VkResult WINAPI wine_vkEnumerateInstanceExtensionProperties(const char *layer_name, uint32_t *count, + VkExtensionProperties *properties) +{ + FIXME("stub: %p %p %p\n", layer_name, count, properties); + return VK_ERROR_OUT_OF_HOST_MEMORY; +} + +static PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance, const char *name) +{ + void *func; + TRACE("%p %s\n", instance, debugstr_a(name)); + + if (!name) + return NULL; + + /* vkGetInstanceProcAddr can load most Vulkan functions when an instance is passed in, however + * for a NULL instance it can only load global functions. + */ + func = wine_vk_get_global_proc_addr(name); + if (func) + { + return func; + } + else if (!instance) + { + FIXME("Global function '%s' not found\n", name); + return NULL; + } + + FIXME("Unsupported device or instance function: '%s'\n", name); return NULL; }
+void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *name) +{ + TRACE("%p %s\n", instance, debugstr_a(name)); + + /* Initial version of the Vulkan ICD spec required vkGetInstanceProcAddr to be + * exported. vk_icdGetInstanceProcAddr was added later to separete ICD calls from + * Vulkan API. One of them in our case should forward to the other, so just forward + * to the older vkGetInstanceProcAddr. + */ + return wine_vkGetInstanceProcAddr(instance, name); +} + VkResult WINAPI wine_vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t *supported_version) { uint32_t req_version; @@ -71,3 +129,25 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) } return TRUE; } + +static const struct vulkan_func vk_global_dispatch_table[] = +{ + {"vkCreateInstance", &wine_vkCreateInstance}, + {"vkEnumerateInstanceExtensionProperties", &wine_vkEnumerateInstanceExtensionProperties}, + {"vkGetInstanceProcAddr", &wine_vkGetInstanceProcAddr}, +}; + +static void *wine_vk_get_global_proc_addr(const char *name) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(vk_global_dispatch_table); i++) + { + if (strcmp(name, vk_global_dispatch_table[i].name) == 0) + { + TRACE("Found name=%s in global table\n", debugstr_a(name)); + return vk_global_dispatch_table[i].func; + } + } + return NULL; +}
On Fri, Feb 23, 2018 at 8:22 AM, Roderick Colenbrander thunderbird2k@gmail.com wrote:
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com
dlls/winevulkan/vulkan.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 2 deletions(-)
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index d3daf2a99b..ef2e287646 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -34,12 +34,70 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan); */ #define WINE_VULKAN_ICD_VERSION 4
-void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *name) +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) +#endif
+struct vulkan_func +{
- const char *name;
- void *func;
+};
+static void *wine_vk_get_global_proc_addr(const char *name);
+static VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator,
VkInstance *pInstance)
{
- FIXME("stub: %p %s\n", instance, debugstr_a(name));
- FIXME("stub: %p %p %p\n", pCreateInfo, pAllocator, pInstance);
- return VK_ERROR_INCOMPATIBLE_DRIVER;
+}
+static VkResult WINAPI wine_vkEnumerateInstanceExtensionProperties(const char *layer_name, uint32_t *count,
VkExtensionProperties *properties)
+{
- FIXME("stub: %p %p %p\n", layer_name, count, properties);
- return VK_ERROR_OUT_OF_HOST_MEMORY;
+}
+static PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance, const char *name) +{
- void *func;
- TRACE("%p %s\n", instance, debugstr_a(name));
- if (!name)
return NULL;
- /* vkGetInstanceProcAddr can load most Vulkan functions when an instance is passed in, however
* for a NULL instance it can only load global functions.
*/
- func = wine_vk_get_global_proc_addr(name);
- if (func)
- {
return func;
- }
- else if (!instance)
- {
FIXME("Global function '%s' not found\n", name);
debugstr_a(name)
return NULL;
- }
- FIXME("Unsupported device or instance function: '%s'\n", name);
debugstr_a(name)
return NULL;
}
+void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *name) +{
- TRACE("%p %s\n", instance, debugstr_a(name));
- /* Initial version of the Vulkan ICD spec required vkGetInstanceProcAddr to be
* exported. vk_icdGetInstanceProcAddr was added later to separete ICD calls from
* Vulkan API. One of them in our case should forward to the other, so just forward
* to the older vkGetInstanceProcAddr.
*/
- return wine_vkGetInstanceProcAddr(instance, name);
+}
VkResult WINAPI wine_vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t *supported_version) { uint32_t req_version; @@ -71,3 +129,25 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) } return TRUE; }
+static const struct vulkan_func vk_global_dispatch_table[] = +{
- {"vkCreateInstance", &wine_vkCreateInstance},
- {"vkEnumerateInstanceExtensionProperties", &wine_vkEnumerateInstanceExtensionProperties},
- {"vkGetInstanceProcAddr", &wine_vkGetInstanceProcAddr},
+};
+static void *wine_vk_get_global_proc_addr(const char *name) +{
- unsigned int i;
- for (i = 0; i < ARRAY_SIZE(vk_global_dispatch_table); i++)
- {
if (strcmp(name, vk_global_dispatch_table[i].name) == 0)
{
TRACE("Found name=%s in global table\n", debugstr_a(name));
return vk_global_dispatch_table[i].func;
}
- }
- return NULL;
+}
2.14.3
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- dlls/gdi32/Makefile.in | 3 ++- dlls/gdi32/dibdrv/dc.c | 2 ++ dlls/gdi32/driver.c | 6 ++++++ dlls/gdi32/enhmfdrv/dc.c | 1 + dlls/gdi32/enhmfdrv/init.c | 1 + dlls/gdi32/freetype.c | 1 + dlls/gdi32/gdi32.spec | 3 +++ dlls/gdi32/mfdrv/init.c | 1 + dlls/gdi32/path.c | 1 + dlls/gdi32/vulkan.c | 41 +++++++++++++++++++++++++++++++++++++++++ dlls/wineandroid.drv/init.c | 1 + dlls/winemac.drv/gdi.c | 1 + dlls/wineps.drv/init.c | 1 + dlls/winevulkan/Makefile.in | 1 + dlls/winevulkan/vulkan.c | 25 +++++++++++++++++++++++-- dlls/winex11.drv/init.c | 1 + dlls/winex11.drv/xrender.c | 1 + include/wine/gdi_driver.h | 5 ++++- include/wine/vulkan_driver.h | 23 +++++++++++++++++++++++ 19 files changed, 115 insertions(+), 4 deletions(-) create mode 100644 dlls/gdi32/vulkan.c create mode 100644 include/wine/vulkan_driver.h
diff --git a/dlls/gdi32/Makefile.in b/dlls/gdi32/Makefile.in index a0f76d23bb..9e5464de2d 100644 --- a/dlls/gdi32/Makefile.in +++ b/dlls/gdi32/Makefile.in @@ -46,7 +46,8 @@ C_SRCS = \ pen.c \ printdrv.c \ region.c \ - vertical.c + vertical.c \ + vulkan.c
RC_SRCS = gdi32.rc
diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index 2447093921..78f4b7a396 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -520,6 +520,7 @@ const struct gdi_dc_funcs dib_driver = NULL, /* pUnrealizePalette */ NULL, /* pWidenPath */ dibdrv_wine_get_wgl_driver, /* wine_get_wgl_driver */ + NULL, /* wine_get_vulkan_driver */ GDI_PRIORITY_DIB_DRV /* priority */ };
@@ -1146,5 +1147,6 @@ static const struct gdi_dc_funcs window_driver = NULL, /* pUnrealizePalette */ NULL, /* pWidenPath */ windrv_wine_get_wgl_driver, /* wine_get_wgl_driver */ + NULL, /* wine_get_vulkan_driver */ GDI_PRIORITY_DIB_DRV + 10 /* priority */ }; diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index 6a3975a531..fcf016b578 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -681,6 +681,11 @@ static struct opengl_funcs *nulldrv_wine_get_wgl_driver( PHYSDEV dev, UINT versi return (void *)-1; }
+static const struct vulkan_funcs *nulldrv_wine_get_vulkan_driver( PHYSDEV dev, UINT version ) +{ + return NULL; +} + const struct gdi_dc_funcs null_driver = { nulldrv_AbortDoc, /* pAbortDoc */ @@ -810,6 +815,7 @@ const struct gdi_dc_funcs null_driver = nulldrv_UnrealizePalette, /* pUnrealizePalette */ nulldrv_WidenPath, /* pWidenPath */ nulldrv_wine_get_wgl_driver, /* wine_get_wgl_driver */ + nulldrv_wine_get_vulkan_driver, /* wine_get_vulkan_driver */
GDI_PRIORITY_NULL_DRV /* priority */ }; diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c index 37180fec9e..99a089f1a2 100644 --- a/dlls/gdi32/enhmfdrv/dc.c +++ b/dlls/gdi32/enhmfdrv/dc.c @@ -950,5 +950,6 @@ static const struct gdi_dc_funcs emfpath_driver = NULL, /* pUnrealizePalette */ NULL, /* pWidenPath */ NULL, /* wine_get_wgl_driver */ + NULL, /* wine_get_vulkan_driver */ GDI_PRIORITY_PATH_DRV + 1 /* priority */ }; diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index 6f9a95632c..35803bcc33 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -163,6 +163,7 @@ static const struct gdi_dc_funcs emfdrv_driver = NULL, /* pUnrealizePalette */ EMFDRV_WidenPath, /* pWidenPath */ NULL, /* wine_get_wgl_driver */ + NULL, /* wine_get_vulkan_driver */ GDI_PRIORITY_GRAPHICS_DRV /* priority */ };
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 383314794a..37ca6dc5cc 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -8902,6 +8902,7 @@ static const struct gdi_dc_funcs freetype_funcs = NULL, /* pUnrealizePalette */ NULL, /* pWidenPath */ NULL, /* wine_get_wgl_driver */ + NULL, /* wine_get_vulkan_driver */ GDI_PRIORITY_FONT_DRV /* priority */ };
diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index 7792731b9e..2400a51038 100644 --- a/dlls/gdi32/gdi32.spec +++ b/dlls/gdi32/gdi32.spec @@ -524,3 +524,6 @@
# OpenGL @ cdecl __wine_get_wgl_driver(long long) + +# Vulkan +@ cdecl __wine_get_vulkan_driver(long long) diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index 50f8ba3b4e..d766d025e5 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -226,6 +226,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs = NULL, /* pUnrealizePalette */ MFDRV_WidenPath, /* pWidenPath */ NULL, /* wine_get_wgl_driver */ + NULL, /* wine_get_vulkan_driver */ GDI_PRIORITY_GRAPHICS_DRV /* priority */ };
diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c index 51334b28b4..41cab60515 100644 --- a/dlls/gdi32/path.c +++ b/dlls/gdi32/path.c @@ -2245,5 +2245,6 @@ const struct gdi_dc_funcs path_driver = NULL, /* pUnrealizePalette */ NULL, /* pWidenPath */ NULL, /* wine_get_wgl_driver */ + NULL, /* wine_get_vulkan_driver */ GDI_PRIORITY_PATH_DRV /* priority */ }; diff --git a/dlls/gdi32/vulkan.c b/dlls/gdi32/vulkan.c new file mode 100644 index 0000000000..6358417974 --- /dev/null +++ b/dlls/gdi32/vulkan.c @@ -0,0 +1,41 @@ +/* + * Vulkan display driver loading + * + * Copyright (c) 2017 Roderick Colenbrander + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" + +#include "gdi_private.h" + +/*********************************************************************** + * __wine_get_vulkan_driver (GDI32.@) + */ +const struct vulkan_funcs * CDECL __wine_get_vulkan_driver(HDC hdc, UINT version) +{ + const struct vulkan_funcs *ret = NULL; + DC * dc = get_dc_ptr(hdc); + + if (dc) + { + PHYSDEV physdev = GET_DC_PHYSDEV(dc, wine_get_vulkan_driver); + ret = physdev->funcs->wine_get_vulkan_driver(physdev, version); + release_dc_ptr(dc); + } + return ret; +} diff --git a/dlls/wineandroid.drv/init.c b/dlls/wineandroid.drv/init.c index 47ef4a2a86..0dd3e5e686 100644 --- a/dlls/wineandroid.drv/init.c +++ b/dlls/wineandroid.drv/init.c @@ -453,6 +453,7 @@ static const struct gdi_dc_funcs android_drv_funcs = NULL, /* pUnrealizePalette */ NULL, /* pWidenPath */ ANDROID_wine_get_wgl_driver, /* wine_get_wgl_driver */ + NULL, /* wine_get_vulkan_driver */ GDI_PRIORITY_GRAPHICS_DRV /* priority */ };
diff --git a/dlls/winemac.drv/gdi.c b/dlls/winemac.drv/gdi.c index 896016bfb2..1f9ac8be41 100644 --- a/dlls/winemac.drv/gdi.c +++ b/dlls/winemac.drv/gdi.c @@ -418,6 +418,7 @@ static const struct gdi_dc_funcs macdrv_funcs = NULL, /* pUnrealizePalette */ NULL, /* pWidenPath */ macdrv_wine_get_wgl_driver, /* wine_get_wgl_driver */ + NULL, /* wine_get_vulkan_driver */ GDI_PRIORITY_GRAPHICS_DRV /* priority */ };
diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c index 5b328798cc..2eb03b836c 100644 --- a/dlls/wineps.drv/init.c +++ b/dlls/wineps.drv/init.c @@ -908,6 +908,7 @@ static const struct gdi_dc_funcs psdrv_funcs = NULL, /* pUnrealizePalette */ NULL, /* pWidenPath */ NULL, /* wine_get_wgl_driver */ + NULL, /* wine_get_vulkan_driver */ GDI_PRIORITY_GRAPHICS_DRV /* priority */ };
diff --git a/dlls/winevulkan/Makefile.in b/dlls/winevulkan/Makefile.in index 0bffb487e2..859c731c6e 100644 --- a/dlls/winevulkan/Makefile.in +++ b/dlls/winevulkan/Makefile.in @@ -1,4 +1,5 @@ MODULE = winevulkan.dll +IMPORTS = user32 gdi32
C_SRCS = \ vulkan.c diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index ef2e287646..ef98f03e37 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -21,9 +21,11 @@
#include "windef.h" #include "winbase.h" +#include "winuser.h"
#include "wine/debug.h" #include "wine/vulkan.h" +#include "wine/vulkan_driver.h"
WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
@@ -46,6 +48,26 @@ struct vulkan_func
static void *wine_vk_get_global_proc_addr(const char *name);
+static const struct vulkan_funcs *vk_funcs = NULL; + +static BOOL wine_vk_init(HINSTANCE hinst) +{ + HDC hdc = GetDC(0); + + vk_funcs = __wine_get_vulkan_driver(hdc, WINE_VULKAN_DRIVER_VERSION); + if (!vk_funcs) + { + ERR("Failed to load Wine graphics driver supporting Vulkan.\n"); + ReleaseDC(0, hdc); + return FALSE; + } + + DisableThreadLibraryCalls(hinst); + + ReleaseDC(0, hdc); + return TRUE; +} + static VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkInstance *pInstance) { @@ -121,8 +143,7 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) switch(reason) { case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hinst); - break; + return wine_vk_init(hinst);
case DLL_THREAD_ATTACH: break; diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index e1eb3f84d3..24ed656405 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -475,6 +475,7 @@ static const struct gdi_dc_funcs x11drv_funcs = X11DRV_UnrealizePalette, /* pUnrealizePalette */ NULL, /* pWidenPath */ X11DRV_wine_get_wgl_driver, /* wine_get_wgl_driver */ + NULL, /* wine_get_vulkan_driver */ GDI_PRIORITY_GRAPHICS_DRV /* priority */ };
diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index b9b7c4f325..4d04741435 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -2284,6 +2284,7 @@ static const struct gdi_dc_funcs xrender_funcs = NULL, /* pUnrealizePalette */ NULL, /* pWidenPath */ NULL, /* wine_get_wgl_driver */ + NULL, /* wine_get_vulkan_driver */ GDI_PRIORITY_GRAPHICS_DRV + 10 /* priority */ };
diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 32d17f7dce..4693235cae 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -25,6 +25,7 @@
struct gdi_dc_funcs; struct opengl_funcs; +struct vulkan_funcs;
typedef struct gdi_physdev { @@ -191,13 +192,14 @@ struct gdi_dc_funcs BOOL (*pUnrealizePalette)(HPALETTE); BOOL (*pWidenPath)(PHYSDEV); struct opengl_funcs * (*wine_get_wgl_driver)(PHYSDEV,UINT); + const struct vulkan_funcs * (*wine_get_vulkan_driver)(PHYSDEV,UINT);
/* priority order for the driver on the stack */ UINT priority; };
/* increment this when you change the DC function table */ -#define WINE_GDI_DRIVER_VERSION 47 +#define WINE_GDI_DRIVER_VERSION 48
#define GDI_PRIORITY_NULL_DRV 0 /* null driver */ #define GDI_PRIORITY_FONT_DRV 100 /* any font driver */ @@ -280,5 +282,6 @@ extern void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis const RECT *device_rect, struct window_surface *surface ); extern void CDECL __wine_set_display_driver( HMODULE module ); extern struct opengl_funcs * CDECL __wine_get_wgl_driver( HDC hdc, UINT version ); +extern const struct vulkan_funcs * CDECL __wine_get_vulkan_driver( HDC hdc, UINT version );
#endif /* __WINE_WINE_GDI_DRIVER_H */ diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h new file mode 100644 index 0000000000..568a2128c3 --- /dev/null +++ b/include/wine/vulkan_driver.h @@ -0,0 +1,23 @@ +/* Automatically generated from Vulkan vk.xml; DO NOT EDIT! */ + +#ifndef __WINE_VULKAN_DRIVER_H +#define __WINE_VULKAN_DRIVER_H + +/* Wine internal vulkan driver version, needs to be bumped upon vulkan_funcs changes. */ +#define WINE_VULKAN_DRIVER_VERSION 1 + +struct vulkan_funcs +{ + /* Vulkan global functions. This are the only calls at this point a graphics driver + * needs to provide. Other function calls will be provided indirectly by dispatch + * tables part of dispatchable Vulkan objects such as VkInstance or vkDevice. + */ + VkResult (*p_vkCreateInstance)(const VkInstanceCreateInfo *, const VkAllocationCallbacks *, VkInstance *); + void (*p_vkDestroyInstance)(VkInstance, const VkAllocationCallbacks *); + VkResult (*p_vkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *); + void * (*p_vkGetInstanceProcAddr)(VkInstance, const char *); +}; + +extern const struct vulkan_funcs * CDECL __wine_get_vulkan_driver(HDC hdc, UINT version); + +#endif /* __WINE_VULKAN_DRIVER_H */
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- dlls/winevulkan/vulkan.c | 8 ++--- dlls/winex11.drv/Makefile.in | 1 + dlls/winex11.drv/init.c | 17 ++++++++++- dlls/winex11.drv/vulkan.c | 71 ++++++++++++++++++++++++++++++++++++++++++++ dlls/winex11.drv/x11drv.h | 1 + 5 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 dlls/winex11.drv/vulkan.c
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index ef98f03e37..8a3927c5c5 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -71,15 +71,15 @@ static BOOL wine_vk_init(HINSTANCE hinst) static VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkInstance *pInstance) { - FIXME("stub: %p %p %p\n", pCreateInfo, pAllocator, pInstance); - return VK_ERROR_INCOMPATIBLE_DRIVER; + TRACE("%p %p %p\n", pCreateInfo, pAllocator, pInstance); + return vk_funcs->p_vkCreateInstance(pCreateInfo, pAllocator, pInstance); }
static VkResult WINAPI wine_vkEnumerateInstanceExtensionProperties(const char *layer_name, uint32_t *count, VkExtensionProperties *properties) { - FIXME("stub: %p %p %p\n", layer_name, count, properties); - return VK_ERROR_OUT_OF_HOST_MEMORY; + TRACE("%p %p %p\n", layer_name, count, properties); + return vk_funcs->p_vkEnumerateInstanceExtensionProperties(layer_name, count, properties); }
static PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance, const char *name) diff --git a/dlls/winex11.drv/Makefile.in b/dlls/winex11.drv/Makefile.in index 463eefdcfb..747f509b44 100644 --- a/dlls/winex11.drv/Makefile.in +++ b/dlls/winex11.drv/Makefile.in @@ -20,6 +20,7 @@ C_SRCS = \ pen.c \ settings.c \ systray.c \ + vulkan.c \ window.c \ wintab.c \ x11drv_main.c \ diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 24ed656405..be5537127a 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -345,6 +345,21 @@ static struct opengl_funcs * X11DRV_wine_get_wgl_driver( PHYSDEV dev, UINT versi return ret; }
+/********************************************************************** + * X11DRV_wine_get_vulkan_driver + */ +static const struct vulkan_funcs * X11DRV_wine_get_vulkan_driver( PHYSDEV dev, UINT version ) +{ + const struct vulkan_funcs *ret; + + if (!(ret = get_vulkan_driver( version ))) + { + dev = GET_NEXT_PHYSDEV( dev, wine_get_vulkan_driver ); + ret = dev->funcs->wine_get_vulkan_driver( dev, version ); + } + return ret; +} +
static const struct gdi_dc_funcs x11drv_funcs = { @@ -475,7 +490,7 @@ static const struct gdi_dc_funcs x11drv_funcs = X11DRV_UnrealizePalette, /* pUnrealizePalette */ NULL, /* pWidenPath */ X11DRV_wine_get_wgl_driver, /* wine_get_wgl_driver */ - NULL, /* wine_get_vulkan_driver */ + X11DRV_wine_get_vulkan_driver, /* wine_get_vulkan_driver */ GDI_PRIORITY_GRAPHICS_DRV /* priority */ };
diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c new file mode 100644 index 0000000000..bfcf95a7ac --- /dev/null +++ b/dlls/winex11.drv/vulkan.c @@ -0,0 +1,71 @@ +/* X11DRV Vulkan implementation + * + * Copyright 2017 Roderick Colenbrander + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" + +#include "wine/debug.h" +#include "wine/vulkan.h" +#include "wine/vulkan_driver.h" + +WINE_DEFAULT_DEBUG_CHANNEL(vulkan); + +static VkResult X11DRV_vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, + VkInstance *pInstance) +{ + FIXME("stub: %p %p %p\n", pCreateInfo, pAllocator, pInstance); + return VK_ERROR_INCOMPATIBLE_DRIVER; +} + +static void X11DRV_vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) +{ + FIXME("stub: %p %p\n", instance, pAllocator); +} + +static VkResult X11DRV_vkEnumerateInstanceExtensionProperties(const char *layer_name, uint32_t *count, + VkExtensionProperties* properties) +{ + FIXME("stub: %s %p %p\n", debugstr_a(layer_name), count, properties); + return VK_ERROR_OUT_OF_HOST_MEMORY; +} + +static void * X11DRV_vkGetInstanceProcAddr(VkInstance instance, const char *name) +{ + FIXME("stub: %p, %s\n", instance, debugstr_a(name)); + return NULL; +} + +static struct vulkan_funcs vulkan_funcs = +{ + X11DRV_vkCreateInstance, + X11DRV_vkDestroyInstance, + X11DRV_vkEnumerateInstanceExtensionProperties, + X11DRV_vkGetInstanceProcAddr +}; + +const struct vulkan_funcs *get_vulkan_driver(UINT version) +{ + if (version != WINE_VULKAN_DRIVER_VERSION) + { + ERR("version mismatch, vulkan wants %u but driver has %u\n", version, WINE_VULKAN_DRIVER_VERSION); + return NULL; + } + + return &vulkan_funcs; +} diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 72036279c6..abd069e1b4 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -223,6 +223,7 @@ extern BOOL shape_layered_windows DECLSPEC_HIDDEN; extern const struct gdi_dc_funcs *X11DRV_XRender_Init(void) DECLSPEC_HIDDEN;
extern struct opengl_funcs *get_glx_driver(UINT) DECLSPEC_HIDDEN; +extern const struct vulkan_funcs *get_vulkan_driver(UINT) DECLSPEC_HIDDEN;
/* IME support */ extern void IME_SetOpenStatus(BOOL fOpen) DECLSPEC_HIDDEN;
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- dlls/winex11.drv/vulkan.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index bfcf95a7ac..3dad034288 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -41,8 +41,32 @@ static void X11DRV_vkDestroyInstance(VkInstance instance, const VkAllocationCall static VkResult X11DRV_vkEnumerateInstanceExtensionProperties(const char *layer_name, uint32_t *count, VkExtensionProperties* properties) { - FIXME("stub: %s %p %p\n", debugstr_a(layer_name), count, properties); - return VK_ERROR_OUT_OF_HOST_MEMORY; + TRACE("layer_name %p, count %p, properties %p\n", debugstr_a(layer_name), count, properties); + + /* This shouldn't get called with pLayerName set, the ICD loader prevents it. */ + if (layer_name) + { + ERR("Layer enumeration not supported from ICD.\n"); + return VK_ERROR_LAYER_NOT_PRESENT; + } + + if (!properties) + { + /* When pProperties is NULL, we need to return the number of extensions supported. + * For now report 0 until we add some e.g. VK_KHR_win32_surface. + * Long-term this needs to be an intersection between what the native library supports + * and what thunks we have. + */ + *count = 0; + return VK_SUCCESS; + } + + /* When pProperties is not NULL, we copy the extensions over and set pPropertyCount to + * the number of copied extensions. For now we don't have much to do as we don't support + * any extensions yet. + */ + *count = 0; + return VK_SUCCESS; }
static void * X11DRV_vkGetInstanceProcAddr(VkInstance instance, const char *name)
On Fri, Feb 23, 2018 at 8:22 AM, Roderick Colenbrander thunderbird2k@gmail.com wrote:
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com
dlls/winex11.drv/vulkan.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index bfcf95a7ac..3dad034288 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -41,8 +41,32 @@ static void X11DRV_vkDestroyInstance(VkInstance instance, const VkAllocationCall static VkResult X11DRV_vkEnumerateInstanceExtensionProperties(const char *layer_name, uint32_t *count, VkExtensionProperties* properties) {
- FIXME("stub: %s %p %p\n", debugstr_a(layer_name), count, properties);
- return VK_ERROR_OUT_OF_HOST_MEMORY;
- TRACE("layer_name %p, count %p, properties %p\n", debugstr_a(layer_name), count, properties);
- /* This shouldn't get called with pLayerName set, the ICD loader prevents it. */
Comment should be updated to match the variable name, i.e. layer_name. Other comments have the same issue.
- if (layer_name)
- {
ERR("Layer enumeration not supported from ICD.\n");
return VK_ERROR_LAYER_NOT_PRESENT;
- }
- if (!properties)
- {
/* When pProperties is NULL, we need to return the number of extensions supported.
* For now report 0 until we add some e.g. VK_KHR_win32_surface.
* Long-term this needs to be an intersection between what the native library supports
* and what thunks we have.
*/
*count = 0;
return VK_SUCCESS;
- }
- /* When pProperties is not NULL, we copy the extensions over and set pPropertyCount to
* the number of copied extensions. For now we don't have much to do as we don't support
* any extensions yet.
*/
- *count = 0;
- return VK_SUCCESS;
}
static void * X11DRV_vkGetInstanceProcAddr(VkInstance instance, const char *name)
2.14.3
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- configure.ac | 9 ++++++ dlls/winevulkan/vulkan.c | 51 +++++++++++++++++++++++++++++-- dlls/winevulkan/vulkan_private.h | 45 ++++++++++++++++++++++++++++ dlls/winex11.drv/vulkan.c | 65 +++++++++++++++++++++++++++++++++++++--- include/config.h.in | 3 ++ 5 files changed, 167 insertions(+), 6 deletions(-) create mode 100644 dlls/winevulkan/vulkan_private.h
diff --git a/configure.ac b/configure.ac index 39c9a4c498..14ed04655e 100644 --- a/configure.ac +++ b/configure.ac @@ -80,6 +80,7 @@ AC_ARG_WITH(sane, AS_HELP_STRING([--without-sane],[do not use SANE (scanner AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF])) AC_ARG_WITH(udev, AS_HELP_STRING([--without-udev],[do not use udev (plug and play support)])) AC_ARG_WITH(v4l, AS_HELP_STRING([--without-v4l],[do not use v4l1 (v4l support)])) +AC_ARG_WITH(vulkan, AS_HELP_STRING([--without-vulkan],[do not use Vulkan])) AC_ARG_WITH(xcomposite,AS_HELP_STRING([--without-xcomposite],[do not use the Xcomposite extension]), [if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xcomposite_h=no; fi]) AC_ARG_WITH(xcursor, AS_HELP_STRING([--without-xcursor],[do not use the Xcursor extension]), @@ -1825,6 +1826,14 @@ then WINE_WARNING([No sound system was found. Windows applications will be silent.]) fi
+dnl *** Check for vulkan *** +if test "x$with_vulkan" != "xno" +then + WINE_CHECK_SONAME(vulkan, vkGetInstanceProcAddr) +fi +WINE_NOTICE_WITH(vulkan,[test "x$ac_cv_lib_soname_vulkan" = "x"], + [libvulkan ${notice_platform}development files not found, vulkan won't be supported.]) + dnl **** Check for gcc specific options ****
AC_SUBST(EXTRACFLAGS,"") diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 8a3927c5c5..c43903d767 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -24,8 +24,10 @@ #include "winuser.h"
#include "wine/debug.h" +#include "wine/heap.h" #include "wine/vulkan.h" #include "wine/vulkan_driver.h" +#include "vulkan_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
@@ -68,11 +70,56 @@ static BOOL wine_vk_init(HINSTANCE hinst) return TRUE; }
+/* Helper function used for freeing an instance structure. This function supports full + * and partial object cleanups and can thus be used for vkCreateInstance failures. + */ +static void wine_vk_instance_free(struct VkInstance_T *instance) +{ + if (!instance) + return; + + if (instance->instance) + vk_funcs->p_vkDestroyInstance(instance->instance, NULL /* pAllocator */); + + heap_free(instance); +} + static VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkInstance *pInstance) { - TRACE("%p %p %p\n", pCreateInfo, pAllocator, pInstance); - return vk_funcs->p_vkCreateInstance(pCreateInfo, pAllocator, pInstance); + struct VkInstance_T *instance = NULL; + VkResult res; + + TRACE("pCreateInfo %p, pAllocator %p, pInstance %p\n", pCreateInfo, pAllocator, pInstance); + + if (pAllocator) + FIXME("Support for allocation callbacks not implemented yet\n"); + + instance = heap_alloc(sizeof(*instance)); + if (!instance) + { + ERR("Failed to allocate memory for instance\n"); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto err; + } + instance->base.loader_magic = VULKAN_ICD_MAGIC_VALUE; + + res = vk_funcs->p_vkCreateInstance(pCreateInfo, NULL /* pAllocator */, &instance->instance); + if (res != VK_SUCCESS) + { + ERR("Failed to create instance, res=%d\n", res); + goto err; + } + + *pInstance = instance; + TRACE("Done, instance=%p native_instance=%p\n", instance, instance->instance); + return VK_SUCCESS; + +err: + if (instance) + wine_vk_instance_free(instance); + + return res; }
static VkResult WINAPI wine_vkEnumerateInstanceExtensionProperties(const char *layer_name, uint32_t *count, diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h new file mode 100644 index 0000000000..6b83e875a2 --- /dev/null +++ b/dlls/winevulkan/vulkan_private.h @@ -0,0 +1,45 @@ +/* Wine Vulkan ICD private data structures + * + * Copyright 2017 Roderick Colenbrander + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_VULKAN_PRIVATE_H +#define __WINE_VULKAN_PRIVATE_H + +/* Magic value defined by Vulkan ICD / Loader spec */ +#define VULKAN_ICD_MAGIC_VALUE 0x01CDC0DE + +/* Base 'class' for our Vulkan dispatchable objects such as VkDevice and VkInstance. + * This structure MUST be the first element of a dispatchable object as the ICD + * loader depends on it. For now only contains loader_magic, but over time more common + * functionality is expected. + */ +struct wine_vk_base +{ + /* Special section in each dispatchable object for use by the ICD loader for + * storing dispatch tables. The start contains a magical value '0x01CDC0DE'. + */ + UINT_PTR loader_magic; +}; + +struct VkInstance_T +{ + struct wine_vk_base base; + VkInstance instance; /* native instance */ +}; + +#endif /* __WINE_VULKAN_PRIVATE_H */ diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 3dad034288..992d2f8908 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -20,22 +20,67 @@ #include "config.h" #include "wine/port.h"
+#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" + #include "wine/debug.h" +#include "wine/library.h" #include "wine/vulkan.h" #include "wine/vulkan_driver.h"
+#ifdef SONAME_LIBVULKAN + WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
+static VkResult (*pvkCreateInstance)(const VkInstanceCreateInfo *, const VkAllocationCallbacks *, VkInstance *); +static void (*pvkDestroyInstance)(VkInstance, const VkAllocationCallbacks *); + +static BOOL wine_vk_init(void) +{ + static BOOL init_done = FALSE; + static void *vulkan_handle; + + if (init_done) return (vulkan_handle != NULL); + init_done = TRUE; + + if (!(vulkan_handle = wine_dlopen(SONAME_LIBVULKAN, RTLD_NOW, NULL, 0))) return FALSE; + +#define LOAD_FUNCPTR(f) if((p##f = wine_dlsym(vulkan_handle, #f, NULL, 0)) == NULL) return FALSE; +LOAD_FUNCPTR(vkCreateInstance) +LOAD_FUNCPTR(vkDestroyInstance) +#undef LOAD_FUNCPTR + + return TRUE; +} + static VkResult X11DRV_vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkInstance *pInstance) { - FIXME("stub: %p %p %p\n", pCreateInfo, pAllocator, pInstance); - return VK_ERROR_INCOMPATIBLE_DRIVER; + TRACE("pCreateInfo %p, pAllocater %p, pInstance %p\n", pCreateInfo, pAllocator, pInstance); + + if (pAllocator) + FIXME("Support for allocation callbacks not implemented yet\n"); + + /* TODO: convert win32 to x11 extensions here. */ + if (pCreateInfo->enabledExtensionCount > 0) + { + FIXME("Extensions are not supported yet, aborting!\n"); + return VK_ERROR_INCOMPATIBLE_DRIVER; + } + + return pvkCreateInstance(pCreateInfo, NULL /* pAllocator */, pInstance); }
static void X11DRV_vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) { - FIXME("stub: %p %p\n", instance, pAllocator); + TRACE("%p %p\n", instance, pAllocator); + + if (pAllocator) + FIXME("Support for allocation callbacks not implemented yet\n"); + + pvkDestroyInstance(instance, NULL /* pAllocator */); }
static VkResult X11DRV_vkEnumerateInstanceExtensionProperties(const char *layer_name, uint32_t *count, @@ -91,5 +136,17 @@ const struct vulkan_funcs *get_vulkan_driver(UINT version) return NULL; }
- return &vulkan_funcs; + if (wine_vk_init()) + return &vulkan_funcs; + + return NULL; } + +#else /* No vulkan */ + +const struct vulkan_funcs *get_vulkan_driver(UINT version) +{ + return NULL; +} + +#endif /* SONAME_LIBVULKAN */ diff --git a/include/config.h.in b/include/config.h.in index d6cddb3c88..c212fd0324 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -1554,6 +1554,9 @@ /* Define to the soname of the libXxf86vm library. */ #undef SONAME_LIBXXF86VM
+/* Define to the soname of the libvulkan library. */ +#undef SONAME_LIBVULKAN + /* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */ #undef STAT_MACROS_BROKEN
On Fri, Feb 23, 2018 at 8:23 AM, Roderick Colenbrander thunderbird2k@gmail.com wrote:
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com
configure.ac | 9 ++++++ dlls/winevulkan/vulkan.c | 51 +++++++++++++++++++++++++++++-- dlls/winevulkan/vulkan_private.h | 45 ++++++++++++++++++++++++++++ dlls/winex11.drv/vulkan.c | 65 +++++++++++++++++++++++++++++++++++++--- include/config.h.in | 3 ++ 5 files changed, 167 insertions(+), 6 deletions(-) create mode 100644 dlls/winevulkan/vulkan_private.h
diff --git a/configure.ac b/configure.ac index 39c9a4c498..14ed04655e 100644 --- a/configure.ac +++ b/configure.ac @@ -80,6 +80,7 @@ AC_ARG_WITH(sane, AS_HELP_STRING([--without-sane],[do not use SANE (scanner AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF])) AC_ARG_WITH(udev, AS_HELP_STRING([--without-udev],[do not use udev (plug and play support)])) AC_ARG_WITH(v4l, AS_HELP_STRING([--without-v4l],[do not use v4l1 (v4l support)])) +AC_ARG_WITH(vulkan, AS_HELP_STRING([--without-vulkan],[do not use Vulkan])) AC_ARG_WITH(xcomposite,AS_HELP_STRING([--without-xcomposite],[do not use the Xcomposite extension]), [if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xcomposite_h=no; fi]) AC_ARG_WITH(xcursor, AS_HELP_STRING([--without-xcursor],[do not use the Xcursor extension]), @@ -1825,6 +1826,14 @@ then WINE_WARNING([No sound system was found. Windows applications will be silent.]) fi
+dnl *** Check for vulkan *** +if test "x$with_vulkan" != "xno" +then
- WINE_CHECK_SONAME(vulkan, vkGetInstanceProcAddr)
+fi +WINE_NOTICE_WITH(vulkan,[test "x$ac_cv_lib_soname_vulkan" = "x"],
[libvulkan ${notice_platform}development files not found, vulkan won't be supported.])
dnl **** Check for gcc specific options ****
AC_SUBST(EXTRACFLAGS,"") diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 8a3927c5c5..c43903d767 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -24,8 +24,10 @@ #include "winuser.h"
#include "wine/debug.h" +#include "wine/heap.h" #include "wine/vulkan.h" #include "wine/vulkan_driver.h" +#include "vulkan_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
@@ -68,11 +70,56 @@ static BOOL wine_vk_init(HINSTANCE hinst) return TRUE; }
+/* Helper function used for freeing an instance structure. This function supports full
- and partial object cleanups and can thus be used for vkCreateInstance failures.
- */
+static void wine_vk_instance_free(struct VkInstance_T *instance) +{
- if (!instance)
return;
- if (instance->instance)
vk_funcs->p_vkDestroyInstance(instance->instance, NULL /* pAllocator */);
- heap_free(instance);
+}
static VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkInstance *pInstance) {
- TRACE("%p %p %p\n", pCreateInfo, pAllocator, pInstance);
- return vk_funcs->p_vkCreateInstance(pCreateInfo, pAllocator, pInstance);
- struct VkInstance_T *instance = NULL;
- VkResult res;
- TRACE("pCreateInfo %p, pAllocator %p, pInstance %p\n", pCreateInfo, pAllocator, pInstance);
- if (pAllocator)
FIXME("Support for allocation callbacks not implemented yet\n");
- instance = heap_alloc(sizeof(*instance));
- if (!instance)
- {
ERR("Failed to allocate memory for instance\n");
res = VK_ERROR_OUT_OF_HOST_MEMORY;
goto err;
- }
- instance->base.loader_magic = VULKAN_ICD_MAGIC_VALUE;
- res = vk_funcs->p_vkCreateInstance(pCreateInfo, NULL /* pAllocator */, &instance->instance);
- if (res != VK_SUCCESS)
- {
ERR("Failed to create instance, res=%d\n", res);
goto err;
- }
- *pInstance = instance;
- TRACE("Done, instance=%p native_instance=%p\n", instance, instance->instance);
- return VK_SUCCESS;
+err:
- if (instance)
wine_vk_instance_free(instance);
Nitpick, wine_vk_instance_free() performs a NULL check.
- return res;
}
static VkResult WINAPI wine_vkEnumerateInstanceExtensionProperties(const char *layer_name, uint32_t *count, diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h new file mode 100644 index 0000000000..6b83e875a2 --- /dev/null +++ b/dlls/winevulkan/vulkan_private.h @@ -0,0 +1,45 @@ +/* Wine Vulkan ICD private data structures
- Copyright 2017 Roderick Colenbrander
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
+#ifndef __WINE_VULKAN_PRIVATE_H +#define __WINE_VULKAN_PRIVATE_H
+/* Magic value defined by Vulkan ICD / Loader spec */ +#define VULKAN_ICD_MAGIC_VALUE 0x01CDC0DE
+/* Base 'class' for our Vulkan dispatchable objects such as VkDevice and VkInstance.
- This structure MUST be the first element of a dispatchable object as the ICD
- loader depends on it. For now only contains loader_magic, but over time more common
- functionality is expected.
- */
+struct wine_vk_base +{
- /* Special section in each dispatchable object for use by the ICD loader for
* storing dispatch tables. The start contains a magical value '0x01CDC0DE'.
*/
- UINT_PTR loader_magic;
+};
+struct VkInstance_T +{
- struct wine_vk_base base;
- VkInstance instance; /* native instance */
+};
+#endif /* __WINE_VULKAN_PRIVATE_H */ diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 3dad034288..992d2f8908 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -20,22 +20,67 @@ #include "config.h" #include "wine/port.h"
+#include <stdarg.h>
+#include "windef.h" +#include "winbase.h"
#include "wine/debug.h" +#include "wine/library.h" #include "wine/vulkan.h" #include "wine/vulkan_driver.h"
+#ifdef SONAME_LIBVULKAN
WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
+static VkResult (*pvkCreateInstance)(const VkInstanceCreateInfo *, const VkAllocationCallbacks *, VkInstance *); +static void (*pvkDestroyInstance)(VkInstance, const VkAllocationCallbacks *);
+static BOOL wine_vk_init(void) +{
- static BOOL init_done = FALSE;
- static void *vulkan_handle;
- if (init_done) return (vulkan_handle != NULL);
- init_done = TRUE;
- if (!(vulkan_handle = wine_dlopen(SONAME_LIBVULKAN, RTLD_NOW, NULL, 0))) return FALSE;
+#define LOAD_FUNCPTR(f) if((p##f = wine_dlsym(vulkan_handle, #f, NULL, 0)) == NULL) return FALSE; +LOAD_FUNCPTR(vkCreateInstance) +LOAD_FUNCPTR(vkDestroyInstance) +#undef LOAD_FUNCPTR
- return TRUE;
+}
static VkResult X11DRV_vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkInstance *pInstance) {
- FIXME("stub: %p %p %p\n", pCreateInfo, pAllocator, pInstance);
- return VK_ERROR_INCOMPATIBLE_DRIVER;
- TRACE("pCreateInfo %p, pAllocater %p, pInstance %p\n", pCreateInfo, pAllocator, pInstance);
Typo: pAllocater.
- if (pAllocator)
FIXME("Support for allocation callbacks not implemented yet\n");
- /* TODO: convert win32 to x11 extensions here. */
- if (pCreateInfo->enabledExtensionCount > 0)
- {
FIXME("Extensions are not supported yet, aborting!\n");
return VK_ERROR_INCOMPATIBLE_DRIVER;
- }
- return pvkCreateInstance(pCreateInfo, NULL /* pAllocator */, pInstance);
}
static void X11DRV_vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) {
- FIXME("stub: %p %p\n", instance, pAllocator);
- TRACE("%p %p\n", instance, pAllocator);
- if (pAllocator)
FIXME("Support for allocation callbacks not implemented yet\n");
- pvkDestroyInstance(instance, NULL /* pAllocator */);
}
static VkResult X11DRV_vkEnumerateInstanceExtensionProperties(const char *layer_name, uint32_t *count, @@ -91,5 +136,17 @@ const struct vulkan_funcs *get_vulkan_driver(UINT version) return NULL; }
- return &vulkan_funcs;
- if (wine_vk_init())
return &vulkan_funcs;
- return NULL;
}
+#else /* No vulkan */
+const struct vulkan_funcs *get_vulkan_driver(UINT version) +{
- return NULL;
+}
+#endif /* SONAME_LIBVULKAN */ diff --git a/include/config.h.in b/include/config.h.in index d6cddb3c88..c212fd0324 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -1554,6 +1554,9 @@ /* Define to the soname of the libXxf86vm library. */ #undef SONAME_LIBXXF86VM
+/* Define to the soname of the libvulkan library. */ +#undef SONAME_LIBVULKAN
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */ #undef STAT_MACROS_BROKEN
-- 2.14.3
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- dlls/winevulkan/Makefile.in | 3 +- dlls/winevulkan/vulkan.c | 13 ++--- dlls/winevulkan/vulkan_private.h | 12 +++++ dlls/winevulkan/vulkan_thunks.c | 106 +++++++++++++++++++++++++++++++++++++++ dlls/winevulkan/vulkan_thunks.h | 9 ++++ 5 files changed, 132 insertions(+), 11 deletions(-) create mode 100644 dlls/winevulkan/vulkan_thunks.c create mode 100644 dlls/winevulkan/vulkan_thunks.h
diff --git a/dlls/winevulkan/Makefile.in b/dlls/winevulkan/Makefile.in index 859c731c6e..a3c40bd398 100644 --- a/dlls/winevulkan/Makefile.in +++ b/dlls/winevulkan/Makefile.in @@ -2,6 +2,7 @@ MODULE = winevulkan.dll IMPORTS = user32 gdi32
C_SRCS = \ - vulkan.c + vulkan.c \ + vulkan_thunks.c
RC_SRCS = version.rc diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index c43903d767..6a0913a59b 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -38,16 +38,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan); */ #define WINE_VULKAN_ICD_VERSION 4
-#ifndef ARRAY_SIZE -#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) -#endif - -struct vulkan_func -{ - const char *name; - void *func; -}; - static void *wine_vk_get_global_proc_addr(const char *name);
static const struct vulkan_funcs *vk_funcs = NULL; @@ -151,6 +141,9 @@ static PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance, return NULL; }
+ func = wine_vk_get_instance_proc_addr(name); + if (func) return func; + FIXME("Unsupported device or instance function: '%s'\n", name); return NULL; } diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index 6b83e875a2..5688137833 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -20,9 +20,21 @@ #ifndef __WINE_VULKAN_PRIVATE_H #define __WINE_VULKAN_PRIVATE_H
+#include "vulkan_thunks.h" + /* Magic value defined by Vulkan ICD / Loader spec */ #define VULKAN_ICD_MAGIC_VALUE 0x01CDC0DE
+#ifndef ARRAY_SIZE +#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) +#endif + +struct vulkan_func +{ + const char *name; + void *func; +}; + /* Base 'class' for our Vulkan dispatchable objects such as VkDevice and VkInstance. * This structure MUST be the first element of a dispatchable object as the ICD * loader depends on it. For now only contains loader_magic, but over time more common diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c new file mode 100644 index 0000000000..57d4f3549b --- /dev/null +++ b/dlls/winevulkan/vulkan_thunks.c @@ -0,0 +1,106 @@ +/* Automatically generated from Vulkan vk.xml; DO NOT EDIT! */ + +#include "config.h" +#include "wine/port.h" + +#include "wine/debug.h" +#include "wine/vulkan.h" +#include "wine/vulkan_driver.h" +#include "vulkan_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(vulkan); + +static VkResult WINAPI wine_vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDevice *pDevice) +{ + FIXME("stub: %p, %p, %p, %p\n", physicalDevice, pCreateInfo, pAllocator, pDevice); + return VK_ERROR_OUT_OF_HOST_MEMORY; +} + +static void WINAPI wine_vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) +{ + FIXME("stub: %p, %p\n", instance, pAllocator); +} + +static VkResult WINAPI wine_vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties) +{ + FIXME("stub: %p, %p, %p, %p\n", physicalDevice, pLayerName, pPropertyCount, pProperties); + return VK_ERROR_OUT_OF_HOST_MEMORY; +} + +static VkResult WINAPI wine_vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkLayerProperties *pProperties) +{ + FIXME("stub: %p, %p, %p\n", physicalDevice, pPropertyCount, pProperties); + return VK_ERROR_OUT_OF_HOST_MEMORY; +} + +static VkResult WINAPI wine_vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices) +{ + FIXME("stub: %p, %p, %p\n", instance, pPhysicalDeviceCount, pPhysicalDevices); + return VK_ERROR_OUT_OF_HOST_MEMORY; +} + +static void WINAPI wine_vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures) +{ + FIXME("stub: %p, %p\n", physicalDevice, pFeatures); +} + +static void WINAPI wine_vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatProperties) +{ + FIXME("stub: %p, %d, %p\n", physicalDevice, format, pFormatProperties); +} + +static VkResult WINAPI wine_vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties) +{ + FIXME("stub: %p, %d, %d, %d, %#x, %#x, %p\n", physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties); + return VK_ERROR_OUT_OF_HOST_MEMORY; +} + +static void WINAPI wine_vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties *pMemoryProperties) +{ + FIXME("stub: %p, %p\n", physicalDevice, pMemoryProperties); +} + +static void WINAPI wine_vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties) +{ + FIXME("stub: %p, %p\n", physicalDevice, pProperties); +} + +static void WINAPI wine_vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties *pQueueFamilyProperties) +{ + FIXME("stub: %p, %p, %p\n", physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); +} + +static void WINAPI wine_vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t *pPropertyCount, VkSparseImageFormatProperties *pProperties) +{ + FIXME("stub: %p, %d, %d, %d, %#x, %d, %p, %p\n", physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties); +} + +static const struct vulkan_func vk_instance_dispatch_table[] = +{ + {"vkCreateDevice", &wine_vkCreateDevice}, + {"vkDestroyInstance", &wine_vkDestroyInstance}, + {"vkEnumerateDeviceExtensionProperties", &wine_vkEnumerateDeviceExtensionProperties}, + {"vkEnumerateDeviceLayerProperties", &wine_vkEnumerateDeviceLayerProperties}, + {"vkEnumeratePhysicalDevices", &wine_vkEnumeratePhysicalDevices}, + {"vkGetPhysicalDeviceFeatures", &wine_vkGetPhysicalDeviceFeatures}, + {"vkGetPhysicalDeviceFormatProperties", &wine_vkGetPhysicalDeviceFormatProperties}, + {"vkGetPhysicalDeviceImageFormatProperties", &wine_vkGetPhysicalDeviceImageFormatProperties}, + {"vkGetPhysicalDeviceMemoryProperties", &wine_vkGetPhysicalDeviceMemoryProperties}, + {"vkGetPhysicalDeviceProperties", &wine_vkGetPhysicalDeviceProperties}, + {"vkGetPhysicalDeviceQueueFamilyProperties", &wine_vkGetPhysicalDeviceQueueFamilyProperties}, + {"vkGetPhysicalDeviceSparseImageFormatProperties", &wine_vkGetPhysicalDeviceSparseImageFormatProperties}, +}; + +void *wine_vk_get_instance_proc_addr(const char *name) +{ + unsigned int i; + for (i = 0; i < ARRAY_SIZE(vk_instance_dispatch_table); i++) + { + if (strcmp(vk_instance_dispatch_table[i].name, name) == 0) + { + TRACE("Found pName=%s in instance table\n", name); + return vk_instance_dispatch_table[i].func; + } + } + return NULL; +} diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h new file mode 100644 index 0000000000..dbfd83c115 --- /dev/null +++ b/dlls/winevulkan/vulkan_thunks.h @@ -0,0 +1,9 @@ +/* Automatically generated from Vulkan vk.xml; DO NOT EDIT! */ + +#ifndef __WINE_VULKAN_THUNKS_H +#define __WINE_VULKAN_THUNKS_H + +/* For use by vk_icdGetInstanceProcAddr / vkGetInstanceProcAddr */ +void *wine_vk_get_instance_proc_addr(const char *name) DECLSPEC_HIDDEN; + +#endif /* __WINE_VULKAN_THUNKS_H */
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- dlls/winevulkan/vulkan.c | 10 ++++++++++ dlls/winevulkan/vulkan_thunks.c | 5 ----- dlls/winevulkan/vulkan_thunks.h | 3 +++ 3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 6a0913a59b..82394761fd 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -112,6 +112,16 @@ err: return res; }
+void WINAPI wine_vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) +{ + TRACE("%p, %p\n", instance, pAllocator); + + if (pAllocator) + FIXME("Support allocation allocators\n"); + + wine_vk_instance_free(instance); +} + static VkResult WINAPI wine_vkEnumerateInstanceExtensionProperties(const char *layer_name, uint32_t *count, VkExtensionProperties *properties) { diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index 57d4f3549b..c1c0b079a5 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -16,11 +16,6 @@ static VkResult WINAPI wine_vkCreateDevice(VkPhysicalDevice physicalDevice, cons return VK_ERROR_OUT_OF_HOST_MEMORY; }
-static void WINAPI wine_vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) -{ - FIXME("stub: %p, %p\n", instance, pAllocator); -} - static VkResult WINAPI wine_vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties) { FIXME("stub: %p, %p, %p, %p\n", physicalDevice, pLayerName, pPropertyCount, pProperties); diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h index dbfd83c115..969bf125f9 100644 --- a/dlls/winevulkan/vulkan_thunks.h +++ b/dlls/winevulkan/vulkan_thunks.h @@ -6,4 +6,7 @@ /* For use by vk_icdGetInstanceProcAddr / vkGetInstanceProcAddr */ void *wine_vk_get_instance_proc_addr(const char *name) DECLSPEC_HIDDEN;
+/* Functions for which we have custom implementations outside of the thunks. */ +void WINAPI wine_vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator) DECLSPEC_HIDDEN; + #endif /* __WINE_VULKAN_THUNKS_H */