[PATCH 0/5] MR9922: winevulkan: Misc make_vulkan extensions refactoring.
From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/win32u/vulkan.c | 2 +- dlls/winevulkan/make_vulkan | 22 ++++-- dlls/winevulkan/vulkan_thunks.c | 125 ++++++-------------------------- 3 files changed, 40 insertions(+), 109 deletions(-) diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index 2b25e44eace..79ed389de2a 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -2280,7 +2280,7 @@ static VkResult queue_submit( struct vulkan_queue *queue, uint32_t count, const for (uint32_t j = 0; j < submit->commandBufferInfoCount; j++) { - VkCommandBufferSubmitInfoKHR *command_buffer_infos = (VkCommandBufferSubmitInfoKHR *)submit->pCommandBufferInfos; /* cast away const, chain has been copied in the thunks */ + VkCommandBufferSubmitInfo *command_buffer_infos = (VkCommandBufferSubmitInfo *)submit->pCommandBufferInfos; /* cast away const, chain has been copied in the thunks */ struct vulkan_command_buffer *command_buffer = vulkan_command_buffer_from_handle( command_buffer_infos[j].commandBuffer ); command_buffer_infos[j].commandBuffer = command_buffer->host.command_buffer; if (command_buffer_infos->pNext) FIXME( "Unhandled struct chain\n" ); diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 792f1d955e2..b0d13137997 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -293,18 +293,27 @@ MANUAL_LOADER_THUNKS = { "vkFreeCommandBuffers", } +# Force making copies of structs even without chains +FORCE_STRUCT_CONVERSIONS = { + "VkPhysicalDeviceExternalBufferInfo", + "VkPhysicalDeviceExternalBufferInfoKHR", + "VkPhysicalDeviceExternalFenceInfo", + "VkPhysicalDeviceExternalFenceInfoKHR", + "VkPhysicalDeviceExternalSemaphoreInfo", + "VkPhysicalDeviceExternalSemaphoreInfoKHR", + "VkCommandBufferSubmitInfo", + "VkCommandBufferSubmitInfoKHR", + "VkSemaphoreSubmitInfo", + "VkSemaphoreSubmitInfoKHR", +} + STRUCT_CHAIN_CONVERSIONS = { # Force making copies of some struct chains "VkMemoryAllocateInfo": {}, "VkBufferCreateInfo": {}, "VkImageCreateInfo": {}, - "VkPhysicalDeviceExternalBufferInfo": {}, - "VkPhysicalDeviceExternalFenceInfo": {}, - "VkPhysicalDeviceExternalSemaphoreInfo": {}, "VkPhysicalDeviceImageFormatInfo2": {}, - "VkCommandBufferSubmitInfo": {}, "VkSemaphoreCreateInfo": {}, - "VkSemaphoreSubmitInfo": {}, "VkFenceCreateInfo": {}, "VkSubmitInfo": {}, "VkSubmitInfo2": {}, @@ -1994,6 +2003,9 @@ class VkStruct(Sequence): if direction == Direction.OUTPUT and re.match("^VkClusterAccelerationStructure",self.name): return False + if direction == Direction.INPUT and self.name in FORCE_STRUCT_CONVERSIONS: + return True + needs_output_copy = False for m in self.members: diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index dc22cf5ebe5..8ab5d7a50af 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -29929,39 +29929,15 @@ static void convert_VkCooperativeVectorPropertiesNV_array_host_to_win32(const Vk } #ifdef _WIN64 -static void convert_VkPhysicalDeviceExternalBufferInfo_win64_to_host(struct conversion_context *ctx, const VkPhysicalDeviceExternalBufferInfo *in, VkPhysicalDeviceExternalBufferInfo *out) +static void convert_VkPhysicalDeviceExternalBufferInfo_win64_to_host(const VkPhysicalDeviceExternalBufferInfo *in, VkPhysicalDeviceExternalBufferInfo *out) { - const VkBaseInStructure *in_header; - VkBaseOutStructure *out_header = (void *)out; - if (!in) return; out->sType = in->sType; - out->pNext = NULL; + out->pNext = in->pNext; out->flags = in->flags; out->usage = in->usage; out->handleType = in->handleType; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO: - { - VkBufferUsageFlags2CreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkBufferUsageFlags2CreateInfo *in_ext = (const VkBufferUsageFlags2CreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->usage = in_ext->usage; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } } #endif /* _WIN64 */ @@ -30018,7 +29994,7 @@ static void convert_VkExternalBufferProperties_host_to_win32(const VkExternalBuf } #ifdef _WIN64 -static void convert_VkPhysicalDeviceExternalFenceInfo_win64_to_host(struct conversion_context *ctx, const VkPhysicalDeviceExternalFenceInfo *in, VkPhysicalDeviceExternalFenceInfo *out) +static void convert_VkPhysicalDeviceExternalFenceInfo_win64_to_host(const VkPhysicalDeviceExternalFenceInfo *in, VkPhysicalDeviceExternalFenceInfo *out) { if (!in) return; @@ -30028,7 +30004,7 @@ static void convert_VkPhysicalDeviceExternalFenceInfo_win64_to_host(struct conve } #endif /* _WIN64 */ -static void convert_VkPhysicalDeviceExternalFenceInfo_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceExternalFenceInfo32 *in, VkPhysicalDeviceExternalFenceInfo *out) +static void convert_VkPhysicalDeviceExternalFenceInfo_win32_to_host(const VkPhysicalDeviceExternalFenceInfo32 *in, VkPhysicalDeviceExternalFenceInfo *out) { if (!in) return; @@ -30059,38 +30035,13 @@ static void convert_VkExternalFenceProperties_host_to_win32(const VkExternalFenc } #ifdef _WIN64 -static void convert_VkPhysicalDeviceExternalSemaphoreInfo_win64_to_host(struct conversion_context *ctx, const VkPhysicalDeviceExternalSemaphoreInfo *in, VkPhysicalDeviceExternalSemaphoreInfo *out) +static void convert_VkPhysicalDeviceExternalSemaphoreInfo_win64_to_host(const VkPhysicalDeviceExternalSemaphoreInfo *in, VkPhysicalDeviceExternalSemaphoreInfo *out) { - const VkBaseInStructure *in_header; - VkBaseOutStructure *out_header = (void *)out; - if (!in) return; out->sType = in->sType; - out->pNext = NULL; + out->pNext = in->pNext; out->handleType = in->handleType; - - for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) - { - switch (in_header->sType) - { - case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: - { - VkSemaphoreTypeCreateInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); - const VkSemaphoreTypeCreateInfo *in_ext = (const VkSemaphoreTypeCreateInfo *)in_header; - out_ext->sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO; - out_ext->pNext = NULL; - out_ext->semaphoreType = in_ext->semaphoreType; - out_ext->initialValue = in_ext->initialValue; - out_header->pNext = (void *)out_ext; - out_header = (void *)out_ext; - break; - } - default: - FIXME("Unhandled sType %u.\n", in_header->sType); - break; - } - } } #endif /* _WIN64 */ @@ -41635,7 +41586,7 @@ static const VkSubmitInfo *convert_VkSubmitInfo_array_win32_to_unwrapped_host(st } #ifdef _WIN64 -static void convert_VkSemaphoreSubmitInfo_win64_to_unwrapped_host(struct conversion_context *ctx, const VkSemaphoreSubmitInfo *in, VkSemaphoreSubmitInfo *out) +static void convert_VkSemaphoreSubmitInfo_win64_to_unwrapped_host(const VkSemaphoreSubmitInfo *in, VkSemaphoreSubmitInfo *out) { if (!in) return; @@ -41659,7 +41610,7 @@ static const VkSemaphoreSubmitInfo *convert_VkSemaphoreSubmitInfo_array_win64_to out = conversion_context_alloc(ctx, count * sizeof(*out)); for (i = 0; i < count; i++) { - convert_VkSemaphoreSubmitInfo_win64_to_unwrapped_host(ctx, &in[i], &out[i]); + convert_VkSemaphoreSubmitInfo_win64_to_unwrapped_host(&in[i], &out[i]); } return out; @@ -41667,7 +41618,7 @@ static const VkSemaphoreSubmitInfo *convert_VkSemaphoreSubmitInfo_array_win64_to #endif /* _WIN64 */ #ifdef _WIN64 -static void convert_VkSemaphoreSubmitInfo_win64_to_host(struct conversion_context *ctx, const VkSemaphoreSubmitInfo *in, VkSemaphoreSubmitInfo *out) +static void convert_VkSemaphoreSubmitInfo_win64_to_host(const VkSemaphoreSubmitInfo *in, VkSemaphoreSubmitInfo *out) { if (!in) return; @@ -41691,7 +41642,7 @@ static const VkSemaphoreSubmitInfo *convert_VkSemaphoreSubmitInfo_array_win64_to out = conversion_context_alloc(ctx, count * sizeof(*out)); for (i = 0; i < count; i++) { - convert_VkSemaphoreSubmitInfo_win64_to_host(ctx, &in[i], &out[i]); + convert_VkSemaphoreSubmitInfo_win64_to_host(&in[i], &out[i]); } return out; @@ -41871,7 +41822,7 @@ static const VkSubmitInfo2 *convert_VkSubmitInfo2_array_win64_to_unwrapped_host( } #endif /* _WIN64 */ -static void convert_VkSemaphoreSubmitInfo_win32_to_unwrapped_host(struct conversion_context *ctx, const VkSemaphoreSubmitInfo32 *in, VkSemaphoreSubmitInfo *out) +static void convert_VkSemaphoreSubmitInfo_win32_to_unwrapped_host(const VkSemaphoreSubmitInfo32 *in, VkSemaphoreSubmitInfo *out) { if (!in) return; @@ -41895,13 +41846,13 @@ static const VkSemaphoreSubmitInfo *convert_VkSemaphoreSubmitInfo_array_win32_to out = conversion_context_alloc(ctx, count * sizeof(*out)); for (i = 0; i < count; i++) { - convert_VkSemaphoreSubmitInfo_win32_to_unwrapped_host(ctx, &in[i], &out[i]); + convert_VkSemaphoreSubmitInfo_win32_to_unwrapped_host(&in[i], &out[i]); } return out; } -static void convert_VkSemaphoreSubmitInfo_win32_to_host(struct conversion_context *ctx, const VkSemaphoreSubmitInfo32 *in, VkSemaphoreSubmitInfo *out) +static void convert_VkSemaphoreSubmitInfo_win32_to_host(const VkSemaphoreSubmitInfo32 *in, VkSemaphoreSubmitInfo *out) { if (!in) return; @@ -41925,7 +41876,7 @@ static const VkSemaphoreSubmitInfo *convert_VkSemaphoreSubmitInfo_array_win32_to out = conversion_context_alloc(ctx, count * sizeof(*out)); for (i = 0; i < count; i++) { - convert_VkSemaphoreSubmitInfo_win32_to_host(ctx, &in[i], &out[i]); + convert_VkSemaphoreSubmitInfo_win32_to_host(&in[i], &out[i]); } return out; @@ -57212,15 +57163,11 @@ static NTSTATUS thunk64_vkGetPhysicalDeviceExternalBufferProperties(void *args) { struct vkGetPhysicalDeviceExternalBufferProperties_params *params = args; VkPhysicalDeviceExternalBufferInfo pExternalBufferInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalBufferInfo, params->pExternalBufferProperties); - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalBufferInfo_win64_to_host(ctx, params->pExternalBufferInfo, &pExternalBufferInfo_host); + convert_VkPhysicalDeviceExternalBufferInfo_win64_to_host(params->pExternalBufferInfo, &pExternalBufferInfo_host); vk_funcs->p_vkGetPhysicalDeviceExternalBufferProperties(params->physicalDevice, &pExternalBufferInfo_host, params->pExternalBufferProperties); - free_conversion_context(ctx); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -57254,15 +57201,11 @@ static NTSTATUS thunk64_vkGetPhysicalDeviceExternalBufferPropertiesKHR(void *arg { struct vkGetPhysicalDeviceExternalBufferPropertiesKHR_params *params = args; VkPhysicalDeviceExternalBufferInfo pExternalBufferInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalBufferInfo, params->pExternalBufferProperties); - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalBufferInfo_win64_to_host(ctx, params->pExternalBufferInfo, &pExternalBufferInfo_host); + convert_VkPhysicalDeviceExternalBufferInfo_win64_to_host(params->pExternalBufferInfo, &pExternalBufferInfo_host); vk_funcs->p_vkGetPhysicalDeviceExternalBufferPropertiesKHR(params->physicalDevice, &pExternalBufferInfo_host, params->pExternalBufferProperties); - free_conversion_context(ctx); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -57296,15 +57239,11 @@ static NTSTATUS thunk64_vkGetPhysicalDeviceExternalFenceProperties(void *args) { struct vkGetPhysicalDeviceExternalFenceProperties_params *params = args; VkPhysicalDeviceExternalFenceInfo pExternalFenceInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalFenceInfo_win64_to_host(ctx, params->pExternalFenceInfo, &pExternalFenceInfo_host); + convert_VkPhysicalDeviceExternalFenceInfo_win64_to_host(params->pExternalFenceInfo, &pExternalFenceInfo_host); wine_vkGetPhysicalDeviceExternalFenceProperties(params->physicalDevice, &pExternalFenceInfo_host, params->pExternalFenceProperties); - free_conversion_context(ctx); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -57319,17 +57258,13 @@ static NTSTATUS thunk32_vkGetPhysicalDeviceExternalFenceProperties(void *args) } *params = args; VkPhysicalDeviceExternalFenceInfo pExternalFenceInfo_host; VkExternalFenceProperties pExternalFenceProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalFenceInfo_win32_to_host(ctx, (const VkPhysicalDeviceExternalFenceInfo32 *)UlongToPtr(params->pExternalFenceInfo), &pExternalFenceInfo_host); + convert_VkPhysicalDeviceExternalFenceInfo_win32_to_host((const VkPhysicalDeviceExternalFenceInfo32 *)UlongToPtr(params->pExternalFenceInfo), &pExternalFenceInfo_host); convert_VkExternalFenceProperties_win32_to_host((VkExternalFenceProperties32 *)UlongToPtr(params->pExternalFenceProperties), &pExternalFenceProperties_host); wine_vkGetPhysicalDeviceExternalFenceProperties((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalFenceInfo_host, &pExternalFenceProperties_host); convert_VkExternalFenceProperties_host_to_win32(&pExternalFenceProperties_host, (VkExternalFenceProperties32 *)UlongToPtr(params->pExternalFenceProperties)); - free_conversion_context(ctx); return STATUS_SUCCESS; } @@ -57338,15 +57273,11 @@ static NTSTATUS thunk64_vkGetPhysicalDeviceExternalFencePropertiesKHR(void *args { struct vkGetPhysicalDeviceExternalFencePropertiesKHR_params *params = args; VkPhysicalDeviceExternalFenceInfo pExternalFenceInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalFenceInfo_win64_to_host(ctx, params->pExternalFenceInfo, &pExternalFenceInfo_host); + convert_VkPhysicalDeviceExternalFenceInfo_win64_to_host(params->pExternalFenceInfo, &pExternalFenceInfo_host); wine_vkGetPhysicalDeviceExternalFencePropertiesKHR(params->physicalDevice, &pExternalFenceInfo_host, params->pExternalFenceProperties); - free_conversion_context(ctx); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -57361,17 +57292,13 @@ static NTSTATUS thunk32_vkGetPhysicalDeviceExternalFencePropertiesKHR(void *args } *params = args; VkPhysicalDeviceExternalFenceInfo pExternalFenceInfo_host; VkExternalFenceProperties pExternalFenceProperties_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; TRACE("%#x, %#x, %#x\n", params->physicalDevice, params->pExternalFenceInfo, params->pExternalFenceProperties); - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalFenceInfo_win32_to_host(ctx, (const VkPhysicalDeviceExternalFenceInfo32 *)UlongToPtr(params->pExternalFenceInfo), &pExternalFenceInfo_host); + convert_VkPhysicalDeviceExternalFenceInfo_win32_to_host((const VkPhysicalDeviceExternalFenceInfo32 *)UlongToPtr(params->pExternalFenceInfo), &pExternalFenceInfo_host); convert_VkExternalFenceProperties_win32_to_host((VkExternalFenceProperties32 *)UlongToPtr(params->pExternalFenceProperties), &pExternalFenceProperties_host); wine_vkGetPhysicalDeviceExternalFencePropertiesKHR((VkPhysicalDevice)UlongToPtr(params->physicalDevice), &pExternalFenceInfo_host, &pExternalFenceProperties_host); convert_VkExternalFenceProperties_host_to_win32(&pExternalFenceProperties_host, (VkExternalFenceProperties32 *)UlongToPtr(params->pExternalFenceProperties)); - free_conversion_context(ctx); return STATUS_SUCCESS; } @@ -57380,15 +57307,11 @@ static NTSTATUS thunk64_vkGetPhysicalDeviceExternalSemaphoreProperties(void *arg { struct vkGetPhysicalDeviceExternalSemaphoreProperties_params *params = args; VkPhysicalDeviceExternalSemaphoreInfo pExternalSemaphoreInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalSemaphoreInfo_win64_to_host(ctx, params->pExternalSemaphoreInfo, &pExternalSemaphoreInfo_host); + convert_VkPhysicalDeviceExternalSemaphoreInfo_win64_to_host(params->pExternalSemaphoreInfo, &pExternalSemaphoreInfo_host); vk_funcs->p_vkGetPhysicalDeviceExternalSemaphoreProperties(params->physicalDevice, &pExternalSemaphoreInfo_host, params->pExternalSemaphoreProperties); - free_conversion_context(ctx); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -57422,15 +57345,11 @@ static NTSTATUS thunk64_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(void * { struct vkGetPhysicalDeviceExternalSemaphorePropertiesKHR_params *params = args; VkPhysicalDeviceExternalSemaphoreInfo pExternalSemaphoreInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; TRACE("%p, %p, %p\n", params->physicalDevice, params->pExternalSemaphoreInfo, params->pExternalSemaphoreProperties); - init_conversion_context(ctx); - convert_VkPhysicalDeviceExternalSemaphoreInfo_win64_to_host(ctx, params->pExternalSemaphoreInfo, &pExternalSemaphoreInfo_host); + convert_VkPhysicalDeviceExternalSemaphoreInfo_win64_to_host(params->pExternalSemaphoreInfo, &pExternalSemaphoreInfo_host); vk_funcs->p_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(params->physicalDevice, &pExternalSemaphoreInfo_host, params->pExternalSemaphoreProperties); - free_conversion_context(ctx); return STATUS_SUCCESS; } #endif /* _WIN64 */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9922
From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/winevulkan/make_vulkan | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index b0d13137997..6156fd61fa6 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -1966,8 +1966,11 @@ class VkStruct(Sequence): def needs_extensions_conversion(self, conv, direction): """ Check if struct contains extensions chain that needs to be converted """ + stripped = STRUCT_CHAIN_CONVERSIONS.get(self.name, {}).get("strip", []) + struct_extensions = filter(lambda s: s.struct_type not in stripped, self.struct_extensions) + if direction == Direction.INPUT and self.name in STRUCT_CHAIN_CONVERSIONS: - return True + return any(struct_extensions) if not "pNext" in self: return False @@ -1977,7 +1980,7 @@ class VkStruct(Sequence): "VkDescriptorBufferBindingInfoEXT"]: is_const = True - for e in self.struct_extensions: + for e in struct_extensions: if not e.required: continue if e.needs_conversion(conv, Unwrap.HOST, direction, is_const, check_extensions=False): -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9922
From: Rémi Bernon <rbernon@codeweavers.com> Stripping the recursive structure from the chain. --- dlls/winevulkan/make_vulkan | 2 +- dlls/winevulkan/vulkan_thunks.c | 183 ++++++++++++++++++++++++++++++++ include/wine/vulkan.h | 64 +++++++++++ 3 files changed, 248 insertions(+), 1 deletion(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 6156fd61fa6..afa991cd0c8 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -98,7 +98,6 @@ UNSUPPORTED_EXTENSIONS = [ "VK_EXT_present_timing", # Needs time conversion "VK_GOOGLE_display_timing", # Relates to external_semaphore and needs type conversions in bitflags. - "VK_KHR_maintenance7", # Causes infinity recursion in struct convert code "VK_KHR_shared_presentable_image", # Needs WSI work. "VK_KHR_video_encode_h265", # StdVideoH265HrdParameters cannot be handled "VK_KHR_video_decode_h265", # by struct conversions. @@ -321,6 +320,7 @@ STRUCT_CHAIN_CONVERSIONS = { # Ignore to not confuse host loader. "VkDeviceCreateInfo": {"strip": ["VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO"]}, "VkInstanceCreateInfo": {"strip": ["VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO"]}, + "VkPhysicalDeviceLayeredApiPropertiesKHR": {"strip": ["VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_VULKAN_PROPERTIES_KHR"]}, } # Some struct members are conditionally ignored and callers are free to leave them uninitialized. diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index 8ab5d7a50af..8db57a14c2c 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -1194,6 +1194,16 @@ typedef union VkPerformanceValueDataINTEL32 PTR32 valueString; } VkPerformanceValueDataINTEL32; +typedef struct VkPhysicalDeviceLayeredApiPropertiesKHR32 +{ + VkStructureType sType; + PTR32 pNext; + uint32_t vendorID; + uint32_t deviceID; + VkPhysicalDeviceLayeredApiKHR layeredAPI; + char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; +} VkPhysicalDeviceLayeredApiPropertiesKHR32; + typedef struct VkPhysicalDeviceMemoryProperties32 { uint32_t memoryTypeCount; @@ -5519,6 +5529,21 @@ typedef struct VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32 VkBool32 invocationMask; } VkPhysicalDeviceInvocationMaskFeaturesHUAWEI32; +typedef struct VkPhysicalDeviceLayeredApiPropertiesListKHR32 +{ + VkStructureType sType; + PTR32 pNext; + uint32_t layeredApiCount; + PTR32 pLayeredApis; +} VkPhysicalDeviceLayeredApiPropertiesListKHR32; + +typedef struct VkPhysicalDeviceLayeredApiVulkanPropertiesKHR32 +{ + VkStructureType sType; + PTR32 pNext; + VkPhysicalDeviceProperties232 DECLSPEC_ALIGN(8) properties; +} VkPhysicalDeviceLayeredApiVulkanPropertiesKHR32; + typedef struct VkPhysicalDeviceLayeredDriverPropertiesMSFT32 { VkStructureType sType; @@ -5657,6 +5682,27 @@ typedef struct VkPhysicalDeviceMaintenance6Properties32 } VkPhysicalDeviceMaintenance6Properties32; typedef VkPhysicalDeviceMaintenance6Properties32 VkPhysicalDeviceMaintenance6PropertiesKHR32; +typedef struct VkPhysicalDeviceMaintenance7FeaturesKHR32 +{ + VkStructureType sType; + PTR32 pNext; + VkBool32 maintenance7; +} VkPhysicalDeviceMaintenance7FeaturesKHR32; + +typedef struct VkPhysicalDeviceMaintenance7PropertiesKHR32 +{ + VkStructureType sType; + PTR32 pNext; + VkBool32 robustFragmentShadingRateAttachmentAccess; + VkBool32 separateDepthStencilAttachmentAccess; + uint32_t maxDescriptorSetTotalUniformBuffersDynamic; + uint32_t maxDescriptorSetTotalStorageBuffersDynamic; + uint32_t maxDescriptorSetTotalBuffersDynamic; + uint32_t maxDescriptorSetUpdateAfterBindTotalUniformBuffersDynamic; + uint32_t maxDescriptorSetUpdateAfterBindTotalStorageBuffersDynamic; + uint32_t maxDescriptorSetUpdateAfterBindTotalBuffersDynamic; +} VkPhysicalDeviceMaintenance7PropertiesKHR32; + typedef struct VkPhysicalDeviceMaintenance8FeaturesKHR32 { VkStructureType sType; @@ -18269,6 +18315,17 @@ static void convert_VkDeviceCreateInfo_win64_to_host(struct conversion_context * out_header = (void *)out_ext; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR: + { + VkPhysicalDeviceMaintenance7FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkPhysicalDeviceMaintenance7FeaturesKHR *in_ext = (const VkPhysicalDeviceMaintenance7FeaturesKHR *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR; + out_ext->pNext = NULL; + out_ext->maintenance7 = in_ext->maintenance7; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_8_FEATURES_KHR: { VkPhysicalDeviceMaintenance8FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); @@ -21275,6 +21332,17 @@ static void convert_VkDeviceCreateInfo_win32_to_host(struct conversion_context * out_header = (void *)out_ext; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR: + { + VkPhysicalDeviceMaintenance7FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkPhysicalDeviceMaintenance7FeaturesKHR32 *in_ext = (const VkPhysicalDeviceMaintenance7FeaturesKHR32 *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR; + out_ext->pNext = NULL; + out_ext->maintenance7 = in_ext->maintenance7; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_8_FEATURES_KHR: { VkPhysicalDeviceMaintenance8FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); @@ -31300,6 +31368,17 @@ static void convert_VkPhysicalDeviceFeatures2_win32_to_host(struct conversion_co out_header = (void *)out_ext; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR: + { + VkPhysicalDeviceMaintenance7FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkPhysicalDeviceMaintenance7FeaturesKHR32 *in_ext = (const VkPhysicalDeviceMaintenance7FeaturesKHR32 *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR; + out_ext->pNext = NULL; + out_ext->maintenance7 = in_ext->maintenance7; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_8_FEATURES_KHR: { VkPhysicalDeviceMaintenance8FeaturesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); @@ -33920,6 +33999,15 @@ static void convert_VkPhysicalDeviceFeatures2_host_to_win32(const VkPhysicalDevi out_header = (void *)out_ext; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR: + { + VkPhysicalDeviceMaintenance7FeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR); + const VkPhysicalDeviceMaintenance7FeaturesKHR *in_ext = (const VkPhysicalDeviceMaintenance7FeaturesKHR *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR; + out_ext->maintenance7 = in_ext->maintenance7; + out_header = (void *)out_ext; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_8_FEATURES_KHR: { VkPhysicalDeviceMaintenance8FeaturesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_8_FEATURES_KHR); @@ -36106,6 +36194,32 @@ static void convert_VkPhysicalDeviceProperties_host_to_win32(const VkPhysicalDev out->sparseProperties = in->sparseProperties; } +static void convert_VkPhysicalDeviceLayeredApiPropertiesKHR_win32_to_host(const VkPhysicalDeviceLayeredApiPropertiesKHR32 *in, VkPhysicalDeviceLayeredApiPropertiesKHR *out) +{ + if (!in) return; + + out->sType = in->sType; + out->pNext = NULL; + if (in->pNext) + FIXME("Unexpected pNext\n"); +} + +static VkPhysicalDeviceLayeredApiPropertiesKHR *convert_VkPhysicalDeviceLayeredApiPropertiesKHR_array_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceLayeredApiPropertiesKHR32 *in, uint32_t count) +{ + VkPhysicalDeviceLayeredApiPropertiesKHR *out; + unsigned int i; + + if (!in || !count) return NULL; + + out = conversion_context_alloc(ctx, count * sizeof(*out)); + for (i = 0; i < count; i++) + { + convert_VkPhysicalDeviceLayeredApiPropertiesKHR_win32_to_host(&in[i], &out[i]); + } + + return out; +} + static void convert_VkPhysicalDeviceProperties2_win32_to_host(struct conversion_context *ctx, const VkPhysicalDeviceProperties232 *in, VkPhysicalDeviceProperties2 *out) { const VkBaseInStructure32 *in_header; @@ -36482,6 +36596,18 @@ static void convert_VkPhysicalDeviceProperties2_win32_to_host(struct conversion_ out_header = (void *)out_ext; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_PROPERTIES_LIST_KHR: + { + VkPhysicalDeviceLayeredApiPropertiesListKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkPhysicalDeviceLayeredApiPropertiesListKHR32 *in_ext = (const VkPhysicalDeviceLayeredApiPropertiesListKHR32 *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_PROPERTIES_LIST_KHR; + out_ext->pNext = NULL; + out_ext->layeredApiCount = in_ext->layeredApiCount; + out_ext->pLayeredApis = convert_VkPhysicalDeviceLayeredApiPropertiesKHR_array_win32_to_host(ctx, (VkPhysicalDeviceLayeredApiPropertiesKHR32 *)UlongToPtr(in_ext->pLayeredApis), in_ext->layeredApiCount); + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT: { VkPhysicalDeviceLayeredDriverPropertiesMSFT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); @@ -36554,6 +36680,15 @@ static void convert_VkPhysicalDeviceProperties2_win32_to_host(struct conversion_ out_header = (void *)out_ext; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_PROPERTIES_KHR: + { + VkPhysicalDeviceMaintenance7PropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_PROPERTIES_KHR; + out_ext->pNext = NULL; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_9_PROPERTIES_KHR: { VkPhysicalDeviceMaintenance9PropertiesKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); @@ -37041,6 +37176,28 @@ static void convert_VkPhysicalDeviceProperties2_win32_to_host(struct conversion_ } } +static void convert_VkPhysicalDeviceLayeredApiPropertiesKHR_host_to_win32(const VkPhysicalDeviceLayeredApiPropertiesKHR *in, VkPhysicalDeviceLayeredApiPropertiesKHR32 *out) +{ + if (!in) return; + + out->vendorID = in->vendorID; + out->deviceID = in->deviceID; + out->layeredAPI = in->layeredAPI; + memcpy(out->deviceName, in->deviceName, VK_MAX_PHYSICAL_DEVICE_NAME_SIZE * sizeof(char)); +} + +static void convert_VkPhysicalDeviceLayeredApiPropertiesKHR_array_host_to_win32(const VkPhysicalDeviceLayeredApiPropertiesKHR *in, VkPhysicalDeviceLayeredApiPropertiesKHR32 *out, uint32_t count) +{ + unsigned int i; + + if (!in) return; + + for (i = 0; i < count; i++) + { + convert_VkPhysicalDeviceLayeredApiPropertiesKHR_host_to_win32(&in[i], &out[i]); + } +} + static void convert_VkPhysicalDeviceProperties2_host_to_win32(const VkPhysicalDeviceProperties2 *in, VkPhysicalDeviceProperties232 *out) { const VkBaseInStructure *in_header; @@ -37577,6 +37734,16 @@ static void convert_VkPhysicalDeviceProperties2_host_to_win32(const VkPhysicalDe out_header = (void *)out_ext; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_PROPERTIES_LIST_KHR: + { + VkPhysicalDeviceLayeredApiPropertiesListKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_PROPERTIES_LIST_KHR); + const VkPhysicalDeviceLayeredApiPropertiesListKHR *in_ext = (const VkPhysicalDeviceLayeredApiPropertiesListKHR *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_PROPERTIES_LIST_KHR; + out_ext->layeredApiCount = in_ext->layeredApiCount; + convert_VkPhysicalDeviceLayeredApiPropertiesKHR_array_host_to_win32(in_ext->pLayeredApis, (VkPhysicalDeviceLayeredApiPropertiesKHR32 *)UlongToPtr(out_ext->pLayeredApis), in_ext->layeredApiCount); + out_header = (void *)out_ext; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT: { VkPhysicalDeviceLayeredDriverPropertiesMSFT32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT); @@ -37659,6 +37826,22 @@ static void convert_VkPhysicalDeviceProperties2_host_to_win32(const VkPhysicalDe out_header = (void *)out_ext; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_PROPERTIES_KHR: + { + VkPhysicalDeviceMaintenance7PropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_PROPERTIES_KHR); + const VkPhysicalDeviceMaintenance7PropertiesKHR *in_ext = (const VkPhysicalDeviceMaintenance7PropertiesKHR *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_PROPERTIES_KHR; + out_ext->robustFragmentShadingRateAttachmentAccess = in_ext->robustFragmentShadingRateAttachmentAccess; + out_ext->separateDepthStencilAttachmentAccess = in_ext->separateDepthStencilAttachmentAccess; + out_ext->maxDescriptorSetTotalUniformBuffersDynamic = in_ext->maxDescriptorSetTotalUniformBuffersDynamic; + out_ext->maxDescriptorSetTotalStorageBuffersDynamic = in_ext->maxDescriptorSetTotalStorageBuffersDynamic; + out_ext->maxDescriptorSetTotalBuffersDynamic = in_ext->maxDescriptorSetTotalBuffersDynamic; + out_ext->maxDescriptorSetUpdateAfterBindTotalUniformBuffersDynamic = in_ext->maxDescriptorSetUpdateAfterBindTotalUniformBuffersDynamic; + out_ext->maxDescriptorSetUpdateAfterBindTotalStorageBuffersDynamic = in_ext->maxDescriptorSetUpdateAfterBindTotalStorageBuffersDynamic; + out_ext->maxDescriptorSetUpdateAfterBindTotalBuffersDynamic = in_ext->maxDescriptorSetUpdateAfterBindTotalBuffersDynamic; + out_header = (void *)out_ext; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_9_PROPERTIES_KHR: { VkPhysicalDeviceMaintenance9PropertiesKHR32 *out_ext = find_next_struct32(out_header, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_9_PROPERTIES_KHR); diff --git a/include/wine/vulkan.h b/include/wine/vulkan.h index 7897ffd53b3..63b6ce54d58 100644 --- a/include/wine/vulkan.h +++ b/include/wine/vulkan.h @@ -784,6 +784,8 @@ typedef struct _XDisplay Display; #define VK_KHR_SHADER_RELAXED_EXTENDED_INSTRUCTION_EXTENSION_NAME "VK_KHR_shader_relaxed_extended_instruction" #define VK_NV_COMMAND_BUFFER_INHERITANCE_SPEC_VERSION 1 #define VK_NV_COMMAND_BUFFER_INHERITANCE_EXTENSION_NAME "VK_NV_command_buffer_inheritance" +#define VK_KHR_MAINTENANCE_7_SPEC_VERSION 1 +#define VK_KHR_MAINTENANCE_7_EXTENSION_NAME "VK_KHR_maintenance7" #define VK_NV_SHADER_ATOMIC_FLOAT16_VECTOR_SPEC_VERSION 1 #define VK_NV_SHADER_ATOMIC_FLOAT16_VECTOR_EXTENSION_NAME "VK_NV_shader_atomic_float16_vector" #define VK_EXT_SHADER_REPLICATED_COMPOSITES_SPEC_VERSION 1 @@ -4407,6 +4409,16 @@ typedef enum VkPhysicalDeviceDataGraphProcessingEngineTypeARM VK_PHYSICAL_DEVICE_DATA_GRAPH_PROCESSING_ENGINE_TYPE_ARM_MAX_ENUM = 0x7fffffff, } VkPhysicalDeviceDataGraphProcessingEngineTypeARM; +typedef enum VkPhysicalDeviceLayeredApiKHR +{ + VK_PHYSICAL_DEVICE_LAYERED_API_VULKAN_KHR = 0, + VK_PHYSICAL_DEVICE_LAYERED_API_D3D12_KHR = 1, + VK_PHYSICAL_DEVICE_LAYERED_API_METAL_KHR = 2, + VK_PHYSICAL_DEVICE_LAYERED_API_OPENGL_KHR = 3, + VK_PHYSICAL_DEVICE_LAYERED_API_OPENGLES_KHR = 4, + VK_PHYSICAL_DEVICE_LAYERED_API_KHR_MAX_ENUM = 0x7fffffff, +} VkPhysicalDeviceLayeredApiKHR; + typedef VkFlags64 VkPhysicalDeviceSchedulingControlsFlagBitsARM; static const VkPhysicalDeviceSchedulingControlsFlagBitsARM VK_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_SHADER_CORE_COUNT_ARM = 0x00000001ull; @@ -6271,6 +6283,11 @@ typedef enum VkStructureType VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV = 1000555000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR = 1000558000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMMAND_BUFFER_INHERITANCE_FEATURES_NV = 1000559000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR = 1000562000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_PROPERTIES_KHR = 1000562001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_PROPERTIES_LIST_KHR = 1000562002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_PROPERTIES_KHR = 1000562003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_VULKAN_PROPERTIES_KHR = 1000562004, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV = 1000563000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT = 1000564000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT8_FEATURES_EXT = 1000567000, @@ -9810,6 +9827,16 @@ typedef struct VkPhysicalDeviceFeatures VkBool32 inheritedQueries; } VkPhysicalDeviceFeatures; +typedef struct VkPhysicalDeviceLayeredApiPropertiesKHR +{ + VkStructureType sType; + void *pNext; + uint32_t vendorID; + uint32_t deviceID; + VkPhysicalDeviceLayeredApiKHR layeredAPI; + char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; +} VkPhysicalDeviceLayeredApiPropertiesKHR; + typedef struct VkPhysicalDeviceMemoryProperties { uint32_t memoryTypeCount; @@ -14790,6 +14817,21 @@ typedef struct VkPhysicalDeviceInvocationMaskFeaturesHUAWEI VkBool32 invocationMask; } VkPhysicalDeviceInvocationMaskFeaturesHUAWEI; +typedef struct VkPhysicalDeviceLayeredApiPropertiesListKHR +{ + VkStructureType sType; + void *pNext; + uint32_t layeredApiCount; + VkPhysicalDeviceLayeredApiPropertiesKHR *pLayeredApis; +} VkPhysicalDeviceLayeredApiPropertiesListKHR; + +typedef struct VkPhysicalDeviceLayeredApiVulkanPropertiesKHR +{ + VkStructureType sType; + void *pNext; + VkPhysicalDeviceProperties2 WINE_VK_ALIGN(8) properties; +} VkPhysicalDeviceLayeredApiVulkanPropertiesKHR; + typedef struct VkPhysicalDeviceLayeredDriverPropertiesMSFT { VkStructureType sType; @@ -14928,6 +14970,27 @@ typedef struct VkPhysicalDeviceMaintenance6Properties } VkPhysicalDeviceMaintenance6Properties; typedef VkPhysicalDeviceMaintenance6Properties VkPhysicalDeviceMaintenance6PropertiesKHR; +typedef struct VkPhysicalDeviceMaintenance7FeaturesKHR +{ + VkStructureType sType; + void *pNext; + VkBool32 maintenance7; +} VkPhysicalDeviceMaintenance7FeaturesKHR; + +typedef struct VkPhysicalDeviceMaintenance7PropertiesKHR +{ + VkStructureType sType; + void *pNext; + VkBool32 robustFragmentShadingRateAttachmentAccess; + VkBool32 separateDepthStencilAttachmentAccess; + uint32_t maxDescriptorSetTotalUniformBuffersDynamic; + uint32_t maxDescriptorSetTotalStorageBuffersDynamic; + uint32_t maxDescriptorSetTotalBuffersDynamic; + uint32_t maxDescriptorSetUpdateAfterBindTotalUniformBuffersDynamic; + uint32_t maxDescriptorSetUpdateAfterBindTotalStorageBuffersDynamic; + uint32_t maxDescriptorSetUpdateAfterBindTotalBuffersDynamic; +} VkPhysicalDeviceMaintenance7PropertiesKHR; + typedef struct VkPhysicalDeviceMaintenance8FeaturesKHR { VkStructureType sType; @@ -21417,6 +21480,7 @@ VkResult VKAPI_CALL vkWriteMicromapsPropertiesEXT(VkDevice device, uint32_t micr USE_VK_EXT(VK_KHR_maintenance4) \ USE_VK_EXT(VK_KHR_maintenance5) \ USE_VK_EXT(VK_KHR_maintenance6) \ + USE_VK_EXT(VK_KHR_maintenance7) \ USE_VK_EXT(VK_KHR_maintenance8) \ USE_VK_EXT(VK_KHR_maintenance9) \ USE_VK_EXT(VK_KHR_map_memory2) \ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9922
From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/winevulkan/make_vulkan | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index afa991cd0c8..cf0bf4f0930 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -65,7 +65,6 @@ LOGGER = logging.Logger("vulkan") LOGGER.addHandler(logging.StreamHandler()) VK_XML_VERSION = "1.4.335" -WINE_VK_VERSION = (1, 4) # Filenames to create. WINE_VULKAN_H = "../../include/wine/vulkan.h" @@ -2613,7 +2612,8 @@ class VkGenerator(object): f.write("#ifndef __WINE_VULKAN_THUNKS_H\n") f.write("#define __WINE_VULKAN_THUNKS_H\n\n") - f.write("#define WINE_VK_VERSION VK_API_VERSION_{0}_{1}\n\n".format(WINE_VK_VERSION[0], WINE_VK_VERSION[1])) + major, minor, patch = VK_XML_VERSION.split('.') + f.write("#define WINE_VK_VERSION VK_API_VERSION_{0}_{1}\n\n".format(major, minor)) # Generate prototypes for device and instance functions requiring a custom implementation. f.write("/* Functions for which we have custom implementations outside of the thunks. */\n") @@ -2955,15 +2955,6 @@ class VkRegistry(object): self.funcs = {} self.types = {} - self.version_regex = re.compile( - r'^' - r'VK_VERSION_' - r'(?P<major>[0-9])' - r'_' - r'(?P<minor>[0-9])' - r'$' - ) - # Overall strategy for parsing the registry is to first # parse all type / function definitions. Then parse # features and extensions to decide which types / functions @@ -2996,14 +2987,6 @@ class VkRegistry(object): self._match_object_types() - def _is_feature_supported(self, feature): - version = self.version_regex.match(feature) - if not version: - return True - - version = tuple(map(int, version.group('major', 'minor'))) - return version <= WINE_VK_VERSION - def _is_extension_supported(self, extension): # We disable some extensions as either we haven't implemented # support yet or because they are for platforms other than win32. @@ -3301,10 +3284,6 @@ class VkRegistry(object): type_info = self.types[t.attrib["name"]] type_info["extension"] = ext_name self._require_type(type_info["data"]) - feature = require.attrib.get("feature") - if feature and not self._is_feature_supported(feature): - continue - required_extension = require.attrib.get("extension") if required_extension and not self._is_extension_supported(required_extension): continue @@ -3348,15 +3327,12 @@ class VkRegistry(object): """ Parse the feature section, which describes Core commands and types needed. """ for feature in filter(is_api_supported, root.findall("./feature")): - feature_name = feature.attrib["name"] for require in feature.findall("require"): LOGGER.info("Including features for {0}".format(require.attrib.get("comment"))) for tag in require: if tag.tag == "comment": continue elif tag.tag == "command": - if not self._is_feature_supported(feature_name): - continue name = tag.attrib["name"] self._mark_command_required(name) elif tag.tag == "enum": -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9922
From: Rémi Bernon <rbernon@codeweavers.com> Extensions are not necessarily in order and we need to check their dependencies before them to correctly flag unsupported extensions. --- dlls/winevulkan/make_vulkan | 114 +++++++++++++++++++----------------- 1 file changed, 60 insertions(+), 54 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index cf0bf4f0930..0a8b324e508 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -85,7 +85,7 @@ WINE_VULKAN_LOADER_THUNKS_H = "loader_thunks.h" EXT_BASE = 1000000000 EXT_BLOCK_SIZE = 1000 -UNSUPPORTED_EXTENSIONS = [ +UNSUPPORTED_EXTENSIONS = { # Instance extensions "VK_KHR_display", # Needs WSI work. "VK_KHR_surface_protected_capabilities", @@ -116,7 +116,11 @@ UNSUPPORTED_EXTENSIONS = [ # Deprecated extensions "VK_NV_external_memory_capabilities", "VK_NV_external_memory_win32", -] +} +UNSUPPORTED_EXTGROUPS = ( + "VK_KHX", + "VK_NVX", +) # Either internal extensions which aren't present on the win32 platform which # winevulkan may nonetheless use, or extensions we want to generate headers for @@ -377,6 +381,11 @@ def convert_suffix(direction, win_type, unwrap, is_wrapped): return "{0}_to_host".format(win_type) +# return any element within the list that is not yet in the `seen` set +def unique(list, key=lambda x: x, seen=set()): + return (e for e in list if not (key(e) in seen or seen.add(key(e)))) + + # Arrays come in multiple formats. Known formats are: # # <member><type>uint32_t</type> <name>foo</name>[<enum>VK_FOO_SIZE</enum>][<enum>VK_FOO_COUNT</enum>]</member> @@ -2499,14 +2508,12 @@ class VkGenerator(object): thunks += vk_func.thunk(conversions, prefix="thunk64_") thunks += vk_func.thunk(conversions, prefix="thunk32_", conv=True) - def unique(list, key=lambda x: x, seen=set()): - return (e for e in list if not (key(e) in seen or seen.add(key(e)))) - - def enum_conversions(conversions, visited=set()): - for conversion in unique(conversions, key=lambda conv: conv.name): + # iterate over each of the conversion function dependencies first + def enum_conversions(conversions, seen=set()): + for conversion in unique(conversions, key=lambda conv: conv.name, seen=seen): dependencies = [] definition = conversion.definition(dependencies) - yield from enum_conversions(dependencies, visited) + yield from enum_conversions(dependencies, seen) yield definition, conversion conv_helpers = "" @@ -2987,11 +2994,6 @@ class VkRegistry(object): self._match_object_types() - def _is_extension_supported(self, extension): - # We disable some extensions as either we haven't implemented - # support yet or because they are for platforms other than win32. - return extension not in UNSUPPORTED_EXTENSIONS - def _mark_command_required(self, command): """ Helper function to mark a certain command and the datatypes it needs as required.""" def mark_bitmask_dependencies(bitmask, types): @@ -3194,10 +3196,51 @@ class VkRegistry(object): def _parse_extensions(self, root): """ Parse extensions section and pull in any types and commands for this extension. """ - extensions = [] exts = root.findall("./extensions/extension") + exts = {ext.attrib["name"]: ext for ext in exts} + + + # return a dict of required extensions for an extension + def required_extensions(ext): + features = [req.attrib.get("feature") for req in ext.findall("require")] + requires = ext.attrib.get("requires", "").split(",") + depends = re.split(r'\W+', ext.attrib.get("depends", "")) + return {name: exts[name] for name in set(requires + depends + features) & exts.keys()} + + # return a set of required features for an extension + def required_versions(ext): + features = [req.attrib.get("feature") for req in ext.findall("require")] + depends = re.split(r'\W+', ext.attrib.get("depends", "")) + versions = filter(None, set(depends + features) - exts.keys()) + regex = re.compile(r"VERSION_(\d)_(\d)$") + return (tuple(map(int, regex.search(name).groups())) for name in versions) + + # iterate over each of the extension dependencies first + def enum_extensions(extensions, seen=set()): + for name in unique(extensions.keys(), seen=seen): + depends = required_extensions(extensions[name]) + yield from enum_extensions(depends, seen) + yield name, extensions[name], depends.keys() + + # transitively iterate over required extensions to flag unsupported extensions + for name, ext, depends in enum_extensions(exts): + if depends & UNSUPPORTED_EXTENSIONS: + UNSUPPORTED_EXTENSIONS.add(name) + elif ext.attrib.get("platform", "win32") not in UNEXPOSED_PLATFORMS | {"win32"}: + UNSUPPORTED_EXTENSIONS.add(name) + # Some extensions are not ready or have numbers reserved as a place holder + # or are only supported for VulkanSC. + elif not set(ext.attrib.get("supported").split(",")) & {"vulkan"}: + UNSUPPORTED_EXTENSIONS.add(name) + # Disable highly experimental extensions as the APIs are unstable and can + # change between minor Vulkan revisions until API is final and becomes KHR + # or NV. + elif not name in ALLOWED_X_EXTENSIONS and name.startswith(UNSUPPORTED_EXTGROUPS): + UNSUPPORTED_EXTENSIONS.add(name) + + + extensions = [] deferred_exts = [] - skipped_exts = UNSUPPORTED_EXTENSIONS.copy() def process_ext(ext, deferred=False): ext_name = ext.attrib["name"] @@ -3215,11 +3258,7 @@ class VkRegistry(object): if cmd_name in self.funcs: self.funcs[cmd_name].extensions.add(ext_name) - # Some extensions are not ready or have numbers reserved as a place holder - # or are only supported for VulkanSC. - if not "vulkan" in ext.attrib["supported"].split(","): - LOGGER.debug("Skipping disabled extension: {0}".format(ext_name)) - skipped_exts.append(ext_name) + if ext_name in UNSUPPORTED_EXTENSIONS: return # Defer extensions with 'sortorder' as they are order-dependent for spec-parsing. @@ -3227,14 +3266,6 @@ class VkRegistry(object): deferred_exts.append(ext) return - # Disable highly experimental extensions as the APIs are unstable and can - # change between minor Vulkan revisions until API is final and becomes KHR - # or NV. - if ("KHX" in ext_name or "NVX" in ext_name) and ext_name not in ALLOWED_X_EXTENSIONS: - LOGGER.debug("Skipping experimental extension: {0}".format(ext_name)) - skipped_exts.append(ext_name) - return - # Extensions can define EnumValues which alias to provisional extensions. Pre-process # extensions to define any required EnumValues before the platform check below. for require in ext.findall("require"): @@ -3242,28 +3273,6 @@ class VkRegistry(object): for enum_elem in require.findall("enum"): self._process_require_enum(enum_elem, ext, only_aliased=True) - platform = ext.attrib.get("platform") - if platform and platform != "win32" and platform not in UNEXPOSED_PLATFORMS: - LOGGER.debug("Skipping extensions {0} for platform {1}".format(ext_name, platform)) - skipped_exts.append(ext_name) - return - - if not self._is_extension_supported(ext_name): - LOGGER.debug("Skipping unsupported extension: {0}".format(ext_name)) - skipped_exts.append(ext_name) - return - elif "requires" in ext.attrib: - # Check if this extension builds on top of another unsupported extension. - requires = ext.attrib["requires"].split(",") - if len(set(requires).intersection(skipped_exts)) > 0: - skipped_exts.append(ext_name) - return - elif "depends" in ext.attrib: - # The syntax for this is more complex, but this is good enough for now. - if any([sext in ext.attrib["depends"] for sext in skipped_exts]): - skipped_exts.append(ext_name) - return - LOGGER.debug("Loading extension: {0}".format(ext_name)) # Extensions can define one or more require sections each requiring @@ -3284,9 +3293,6 @@ class VkRegistry(object): type_info = self.types[t.attrib["name"]] type_info["extension"] = ext_name self._require_type(type_info["data"]) - required_extension = require.attrib.get("extension") - if required_extension and not self._is_extension_supported(required_extension): - continue # Pull in any commands we need. We infer types to pull in from the command # as well. @@ -3311,7 +3317,7 @@ class VkRegistry(object): # Process extensions, allowing for sortorder to defer extension processing - for ext in exts: + for ext in exts.values(): process_ext(ext) deferred_exts.sort(key=lambda ext: ext.attrib["sortorder"]) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9922
participants (2)
-
Rémi Bernon -
Rémi Bernon (@rbernon)