winevulkan: Return NULL for unavailable instance functions.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49542 Signed-off-by: Georg Lehmann <dadschoorse@gmail.com> Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6dee57f30e
commit
11cfbe5c89
@ -116,6 +116,9 @@ PFN_vkVoidFunction WINAPI vkGetInstanceProcAddr(VkInstance instance, const char
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!unix_funcs->p_is_available_instance_function(instance, name))
|
||||
return NULL;
|
||||
|
||||
func = wine_vk_get_instance_proc_addr(name);
|
||||
if (func) return func;
|
||||
|
||||
@ -175,6 +178,9 @@ void * WINAPI vk_icdGetPhysicalDeviceProcAddr(VkInstance instance, const char *n
|
||||
{
|
||||
TRACE("%p, %s\n", instance, debugstr_a(name));
|
||||
|
||||
if (!unix_funcs->p_is_available_instance_function(instance, name))
|
||||
return NULL;
|
||||
|
||||
return wine_vk_get_phys_dev_proc_addr(name);
|
||||
}
|
||||
|
||||
|
@ -419,6 +419,9 @@ struct unix_funcs
|
||||
VkResult (WINAPI *p_vkWaitSemaphores)(VkDevice, const VkSemaphoreWaitInfo *, uint64_t);
|
||||
VkResult (WINAPI *p_vkWaitSemaphoresKHR)(VkDevice, const VkSemaphoreWaitInfo *, uint64_t);
|
||||
VkResult (WINAPI *p_vkWriteAccelerationStructuresPropertiesKHR)(VkDevice, uint32_t, const VkAccelerationStructureKHR *, VkQueryType, size_t, void *, size_t);
|
||||
|
||||
/* winevulkan specific functions */
|
||||
BOOL (WINAPI *p_is_available_instance_function)(VkInstance, const char *);
|
||||
};
|
||||
|
||||
#endif /* __WINE_VULKAN_LOADER_THUNKS_H */
|
||||
|
@ -2788,6 +2788,7 @@ class VkGenerator(object):
|
||||
continue
|
||||
|
||||
f.write(" &{1}{0},\n".format(vk_func.name, prefix))
|
||||
f.write(" &wine_vk_is_available_instance_function,\n")
|
||||
f.write("};\n")
|
||||
|
||||
def generate_thunks_h(self, f, prefix):
|
||||
@ -2988,6 +2989,9 @@ class VkGenerator(object):
|
||||
continue
|
||||
|
||||
f.write(" {0};\n".format(vk_func.pfn(conv=False, call_conv="WINAPI")))
|
||||
f.write("\n")
|
||||
f.write(" /* winevulkan specific functions */\n")
|
||||
f.write(" BOOL (WINAPI *p_is_available_instance_function)(VkInstance, const char *);\n")
|
||||
f.write("};\n\n")
|
||||
|
||||
f.write("#endif /* __WINE_VULKAN_LOADER_THUNKS_H */\n")
|
||||
|
@ -1605,3 +1605,8 @@ void WINAPI wine_vkDestroyDebugReportCallbackEXT(
|
||||
|
||||
free(object);
|
||||
}
|
||||
|
||||
BOOL WINAPI wine_vk_is_available_instance_function(VkInstance instance, const char *name)
|
||||
{
|
||||
return !!vk_funcs->p_vkGetInstanceProcAddr(instance->instance, name);
|
||||
}
|
||||
|
@ -212,4 +212,6 @@ uint64_t wine_vk_unwrap_handle(VkObjectType type, uint64_t handle) DECLSPEC_HIDD
|
||||
|
||||
extern const struct unix_funcs loader_funcs;
|
||||
|
||||
BOOL WINAPI wine_vk_is_available_instance_function(VkInstance instance, const char *name) DECLSPEC_HIDDEN;
|
||||
|
||||
#endif /* __WINE_VULKAN_PRIVATE_H */
|
||||
|
@ -8719,4 +8719,5 @@ const struct unix_funcs loader_funcs =
|
||||
&wine_vkWaitSemaphores,
|
||||
&wine_vkWaitSemaphoresKHR,
|
||||
&wine_vkWriteAccelerationStructuresPropertiesKHR,
|
||||
&wine_vk_is_available_instance_function,
|
||||
};
|
||||
|
@ -475,7 +475,7 @@
|
||||
#define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0)
|
||||
#define VK_API_VERSION_1_1 VK_MAKE_API_VERSION(0, 1, 1, 0)
|
||||
#define VK_API_VERSION_1_2 VK_MAKE_API_VERSION(0, 1, 2, 0)
|
||||
#define VK_HEADER_VERSION 187
|
||||
#define VK_HEADER_VERSION 188
|
||||
#define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 2, VK_HEADER_VERSION)
|
||||
#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
|
||||
#define VK_USE_64_BIT_PTR_DEFINES 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user