winevulkan: Use __wine_unix_call interface for some Vulkan functions.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-12-10 18:41:16 +01:00 committed by Alexandre Julliard
parent 37be098954
commit c3862f2a61
3 changed files with 261 additions and 242 deletions

View File

@ -377,7 +377,7 @@ void WINAPI vkGetPhysicalDeviceProperties2(VkPhysicalDevice phys_dev,
params.physicalDevice = phys_dev;
params.pProperties = properties2;
unix_funcs->p_vk_call(unix_vkGetPhysicalDeviceProperties2, &params);
vk_unix_call(unix_vkGetPhysicalDeviceProperties2, &params);
fill_luid_property(properties2);
}
@ -390,7 +390,7 @@ void WINAPI vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice phys_dev,
params.physicalDevice = phys_dev;
params.pProperties = properties2;
unix_funcs->p_vk_call(unix_vkGetPhysicalDeviceProperties2KHR, &params);
vk_unix_call(unix_vkGetPhysicalDeviceProperties2KHR, &params);
fill_luid_property(properties2);
}

File diff suppressed because it is too large Load Diff

View File

@ -146,6 +146,16 @@ ALLOWED_X_EXTENSIONS = [
"VK_NVX_image_view_handle",
]
# We can't use syscall interface for functions that may call display drivers
# until drivers are converted to pure Unix libraries. Also some frequently
# called functions use direct calls for performance reasons.
DIRECT_CALL_FUNCTIONS = [
"vkCreateDevice",
"vkEnumerateInstanceVersion",
"vkUpdateDescriptorSets",
"vkUpdateDescriptorSetWithTemplate",
]
# Functions part of our winevulkan graphics driver interface.
# DRIVER_VERSION should be bumped on any change to driver interface
# in FUNCTION_OVERRIDES
@ -668,6 +678,12 @@ class VkFunction(object):
# The function needs exposed if at-least one extension isn't both UNSUPPORTED and UNEXPOSED
return self.is_required() and (not self.extensions or not self.extensions.issubset(UNEXPOSED_EXTENSIONS))
def needs_direct_call(self):
# vkCmd* functions are frequently called, use direct calls for performance
if self.name.startswith("vkCmd"):
return True
return self.is_driver_func() or self.name in DIRECT_CALL_FUNCTIONS
def pfn(self, prefix="p", call_conv=None, conv=False):
""" Create function pointer. """
@ -754,7 +770,10 @@ class VkFunction(object):
# Call the Unix function.
if self.type != "void" and not self.returns_longlong():
body += "return "
body += "unix_funcs->p_vk_call(unix_{0}, &params);\n".format(self.name)
if self.needs_direct_call():
body += "unix_funcs->p_vk_call(unix_{0}, &params);\n".format(self.name)
else:
body += "vk_unix_call(unix_{0}, &params);\n".format(self.name)
if self.returns_longlong():
body += " return params.result;\n"
return body