From: Jacek Caban jacek@codeweavers.com
--- dlls/winevulkan/make_vulkan | 5 ++++- dlls/winevulkan/vulkan_thunks.c | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 6d07423a5ed..34c95b9b620 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -1452,10 +1452,13 @@ class VkMember(VkVariable): # Nothing needed this yet. LOGGER.warn("TODO: implement copying of static array for {0}.{1}".format(self.type, self.name)) elif self.is_handle() and self.needs_unwrapping(): + handle = self.type_info["data"] if direction == Direction.OUTPUT: LOGGER.err("OUTPUT parameter {0}.{1} cannot be unwrapped".format(self.type, self.name)) + elif self.optional: + return "{0}{1} = {2} ? {3} : 0;\n".format(output, self.name, + self.value(input, conv), handle.driver_handle(self.value(input, conv))) else: - handle = self.type_info["data"] return "{0}{1} = {2};\n".format(output, self.name, handle.driver_handle(self.value(input, conv))) elif self.is_generic_handle(): if direction == Direction.OUTPUT: diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index 2181daf678a..57962c91917 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -23444,7 +23444,7 @@ static inline void convert_VkPhysicalDeviceSurfaceInfo2KHR_win64_to_host(const V
out->sType = in->sType; out->pNext = in->pNext; - out->surface = wine_surface_from_handle(in->surface)->driver_surface; + out->surface = in->surface ? wine_surface_from_handle(in->surface)->driver_surface : 0; } #endif /* _WIN64 */
@@ -23454,7 +23454,7 @@ static inline void convert_VkPhysicalDeviceSurfaceInfo2KHR_win32_to_host(const V
out->sType = in->sType; out->pNext = NULL; - out->surface = wine_surface_from_handle(in->surface)->driver_surface; + out->surface = in->surface ? wine_surface_from_handle(in->surface)->driver_surface : 0; if (in->pNext) FIXME("Unexpected pNext\n"); }