From 2ad6d865d17f5dabe888a908030d44b29bad08d9 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Sat, 12 Nov 2022 01:15:53 +0100 Subject: [PATCH] winevulkan: Convert dispatchable handle array struct members. --- dlls/winevulkan/make_vulkan | 6 +++++- dlls/winevulkan/vulkan_thunks.c | 30 +++++++++++++++--------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index d7349120e40..036ef755495 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -1396,7 +1396,9 @@ class VkMember(VkVariable): count = self.array_len if direction == Direction.OUTPUT: # Needed by VkMemoryHeap.memoryHeaps - return "convert_{0}_array_host_to_{5}({2}{1}, {3}{1}, {4});\n".format(self.type, self.name, input, output, count, win_type) + host_part = "host" if unwrap else "unwrapped_host" + return "convert_{0}_array_{6}_to_{5}({2}{1}, {3}{1}, {4});\n".format( + self.type, self.name, input, output, count, win_type, host_part) else: # Nothing needed this yet. LOGGER.warn("TODO: implement copying of static array for {0}.{1}".format(self.type, self.name)) @@ -1485,6 +1487,8 @@ class VkMember(VkVariable): if self.is_handle(): if unwrap and self.handle.is_wrapped(): return True + if conv and self.handle.is_dispatchable(): + return True elif self.is_generic_handle(): if unwrap: return True diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index 32553aba432..db0978f9caa 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -16019,6 +16019,20 @@ static inline void convert_VkDebugMarkerObjectTagInfoEXT_win32_to_host(const VkD } #endif /* USE_STRUCT_CONVERSION */ +#if defined(USE_STRUCT_CONVERSION) +static inline void convert_VkPhysicalDevice_array_unwrapped_host_to_win32(const VkPhysicalDevice *in, VkPhysicalDevice *out, uint32_t count) +{ + unsigned int i; + + if (!in) return; + + for (i = 0; i < count; i++) + { + out[i] = in[i]; + } +} +#endif /* USE_STRUCT_CONVERSION */ + #if defined(USE_STRUCT_CONVERSION) static inline void convert_VkPhysicalDeviceGroupProperties_win32_to_unwrapped_host(const VkPhysicalDeviceGroupProperties32 *in, VkPhysicalDeviceGroupProperties *out) { @@ -16035,7 +16049,7 @@ static inline void convert_VkPhysicalDeviceGroupProperties_unwrapped_host_to_win if (!in) return; out->physicalDeviceCount = in->physicalDeviceCount; - memcpy(out->physicalDevices, in->physicalDevices, VK_MAX_DEVICE_GROUP_SIZE * sizeof(VkPhysicalDevice)); + convert_VkPhysicalDevice_array_unwrapped_host_to_win32(in->physicalDevices, out->physicalDevices, VK_MAX_DEVICE_GROUP_SIZE); out->subsetAllocation = in->subsetAllocation; } #endif /* USE_STRUCT_CONVERSION */ @@ -16180,20 +16194,6 @@ static inline void convert_VkPerformanceCounterDescriptionKHR_array_host_to_win3 } #endif /* USE_STRUCT_CONVERSION */ -#if defined(USE_STRUCT_CONVERSION) -static inline void convert_VkPhysicalDevice_array_unwrapped_host_to_win32(const VkPhysicalDevice *in, VkPhysicalDevice *out, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - out[i] = in[i]; - } -} -#endif /* USE_STRUCT_CONVERSION */ - #if defined(USE_STRUCT_CONVERSION) static inline void convert_VkMappedMemoryRange_win32_to_host(const VkMappedMemoryRange32 *in, VkMappedMemoryRange *out) {