From: Jacek Caban jacek@codeweavers.com
--- dlls/winevulkan/make_vulkan | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 191a0a3be03..967446794e7 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -642,18 +642,6 @@ class VkFunction(object): def returns_longlong(self): return self.type in ["uint64_t", "VkDeviceAddress"]
- def needs_unwrapping(self): - """ Check if the function needs any input/output type unwrapping. - Functions need input/output unwrapping if struct parameters have - wrapped handles. - """ - - for p in self.params: - if p.needs_unwrapping(): - return True - - return False - def needs_dispatch(self): return self.dispatch
@@ -747,7 +735,7 @@ class VkFunction(object): body += " return params.result;\n" return body
- def body(self, conv, unwrap=True, params_prefix=""): + def body(self, conv, unwrap, params_prefix=""): body = "" needs_alloc = False
@@ -2225,17 +2213,6 @@ class StructConversionFunction(object):
return body
- def _set_name(self): - name = "convert_{0}_".format(self.type) - win_type = "win32" if self.conv else "win64" - host_part = "host" if self.unwrap else "unwrapped_host" - if self.direction == Direction.INPUT: - name += "{0}_to_{1}".format(win_type, host_part) - else: # Direction.OUTPUT - name += "{0}_to_{1}".format(host_part, win_type) - - self.name = name -
class ArrayConversionFunction(object): def __init__(self, array, direction, conv, unwrap):
From: Jacek Caban jacek@codeweavers.com
--- dlls/winevulkan/make_vulkan | 40 +++++++++++++------------------------ 1 file changed, 14 insertions(+), 26 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 967446794e7..5d4888e3006 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -1193,6 +1193,20 @@ class VkVariable(object): return not self.handle.is_dispatchable() return False
+ def needs_unwrapping(self): + """ Returns if variable needs unwrapping of handle. """ + + if self.is_struct(): + return self.struct.needs_unwrapping() + + if self.is_handle(): + return self.handle.needs_unwrapping() + + if self.is_generic_handle(): + return True + + return False + def needs_alloc(self, conv, unwrap): """ Returns True if conversion needs allocation """ if self.is_dynamic_array(): @@ -1415,20 +1429,6 @@ class VkMember(VkVariable): def is_bit_field(self): return self.bit_width is not None
- def needs_unwrapping(self): - """ Structures with wrapped handles need unwrapping. """ - - if self.is_struct(): - return self.struct.needs_unwrapping() - - if self.is_handle(): - return self.handle.is_wrapped() - - if self.is_generic_handle(): - return True - - return False - def needs_conversion(self, conv, unwrap, direction, struct_const): """ Check if member needs conversion. """
@@ -1668,18 +1668,6 @@ class VkParam(VkVariable): return True return False
- def needs_unwrapping(self): - """ Returns if parameter needs unwrapping of handle. """ - - # Wrapped handle parameters are handled separately, only look for wrapped handles in structs - if self.is_struct(): - return self.struct.needs_unwrapping() - - if self.is_handle() and self.is_dynamic_array(): - return self.handle.needs_unwrapping() - - return False - def spec(self): """ Generate spec file entry for this parameter. """
From: Jacek Caban jacek@codeweavers.com
--- dlls/winevulkan/make_vulkan | 9 ++++----- dlls/winevulkan/vulkan_thunks.h | 3 --- 2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 5d4888e3006..9bbe923eb33 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -2,6 +2,7 @@ # Wine Vulkan generator # # Copyright 2017-2018 Roderick Colenbrander +# Copyright 2022 Jacek Caban for CodeWeavers # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -645,11 +646,9 @@ class VkFunction(object): def needs_dispatch(self): return self.dispatch
- def needs_thunk(self): - return self.thunk_type != ThunkType.NONE - def needs_private_thunk(self): - return self.thunk_type == ThunkType.PRIVATE + return self.needs_exposing() and self.loader_thunk_type != ThunkType.NONE and \ + self.thunk_type != ThunkType.PUBLIC
def needs_exposing(self): # The function needs exposed if at-least one extension isn't both UNSUPPORTED and UNEXPOSED @@ -2546,7 +2545,7 @@ class VkGenerator(object): # 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") for vk_func in self.registry.funcs.values(): - if not vk_func.needs_exposing() or vk_func.thunk_type == ThunkType.PUBLIC: + if not vk_func.needs_private_thunk(): continue
f.write("{0};\n".format(vk_func.prototype(prefix=prefix, postfix="DECLSPEC_HIDDEN", is_thunk=True))) diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h index c8da040a235..24c94e2b5ee 100644 --- a/dlls/winevulkan/vulkan_thunks.h +++ b/dlls/winevulkan/vulkan_thunks.h @@ -31,17 +31,14 @@ void wine_vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const V VkResult wine_vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties) DECLSPEC_HIDDEN; VkResult wine_vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkLayerProperties *pProperties) DECLSPEC_HIDDEN; VkResult wine_vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties) DECLSPEC_HIDDEN; -VkResult wine_vkEnumerateInstanceLayerProperties(uint32_t *pPropertyCount, VkLayerProperties *pProperties) DECLSPEC_HIDDEN; VkResult wine_vkEnumerateInstanceVersion(uint32_t *pApiVersion) DECLSPEC_HIDDEN; VkResult wine_vkEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties) DECLSPEC_HIDDEN; VkResult wine_vkEnumeratePhysicalDeviceGroupsKHR(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties) DECLSPEC_HIDDEN; VkResult wine_vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices) DECLSPEC_HIDDEN; void wine_vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers) DECLSPEC_HIDDEN; VkResult wine_vkGetCalibratedTimestampsEXT(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT *pTimestampInfos, uint64_t *pTimestamps, uint64_t *pMaxDeviation) DECLSPEC_HIDDEN; -PFN_vkVoidFunction wine_vkGetDeviceProcAddr(VkDevice device, const char *pName) DECLSPEC_HIDDEN; void wine_vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue) DECLSPEC_HIDDEN; void wine_vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2 *pQueueInfo, VkQueue *pQueue) DECLSPEC_HIDDEN; -PFN_vkVoidFunction wine_vkGetInstanceProcAddr(VkInstance instance, const char *pName) DECLSPEC_HIDDEN; VkResult wine_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice physicalDevice, uint32_t *pTimeDomainCount, VkTimeDomainEXT *pTimeDomains) DECLSPEC_HIDDEN; void wine_vkGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties) DECLSPEC_HIDDEN; void wine_vkGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, VkExternalBufferProperties *pExternalBufferProperties) DECLSPEC_HIDDEN;