Commit 007a4bc9 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winevulkan: Don't use wine_ prefix on PE side.

There is no ABI ambiguity, so we may just use public names. Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 368d9cb5
...@@ -60,7 +60,7 @@ static void *wine_vk_find_struct_(void *s, VkStructureType t) ...@@ -60,7 +60,7 @@ static void *wine_vk_find_struct_(void *s, VkStructureType t)
return NULL; return NULL;
} }
VkResult WINAPI wine_vkEnumerateInstanceLayerProperties(uint32_t *count, VkLayerProperties *properties) VkResult WINAPI vkEnumerateInstanceLayerProperties(uint32_t *count, VkLayerProperties *properties)
{ {
TRACE("%p, %p\n", count, properties); TRACE("%p, %p\n", count, properties);
...@@ -71,11 +71,11 @@ VkResult WINAPI wine_vkEnumerateInstanceLayerProperties(uint32_t *count, VkLayer ...@@ -71,11 +71,11 @@ VkResult WINAPI wine_vkEnumerateInstanceLayerProperties(uint32_t *count, VkLayer
static const struct vulkan_func vk_global_dispatch_table[] = static const struct vulkan_func vk_global_dispatch_table[] =
{ {
/* These functions must call wine_vk_init_once() before accessing vk_funcs. */ /* These functions must call wine_vk_init_once() before accessing vk_funcs. */
{"vkCreateInstance", &wine_vkCreateInstance}, {"vkCreateInstance", &vkCreateInstance},
{"vkEnumerateInstanceExtensionProperties", &wine_vkEnumerateInstanceExtensionProperties}, {"vkEnumerateInstanceExtensionProperties", &vkEnumerateInstanceExtensionProperties},
{"vkEnumerateInstanceLayerProperties", &wine_vkEnumerateInstanceLayerProperties}, {"vkEnumerateInstanceLayerProperties", &vkEnumerateInstanceLayerProperties},
{"vkEnumerateInstanceVersion", &wine_vkEnumerateInstanceVersion}, {"vkEnumerateInstanceVersion", &vkEnumerateInstanceVersion},
{"vkGetInstanceProcAddr", &wine_vkGetInstanceProcAddr}, {"vkGetInstanceProcAddr", &vkGetInstanceProcAddr},
}; };
static void *wine_vk_get_global_proc_addr(const char *name) static void *wine_vk_get_global_proc_addr(const char *name)
...@@ -93,7 +93,7 @@ static void *wine_vk_get_global_proc_addr(const char *name) ...@@ -93,7 +93,7 @@ static void *wine_vk_get_global_proc_addr(const char *name)
return NULL; return NULL;
} }
PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance, const char *name) PFN_vkVoidFunction WINAPI vkGetInstanceProcAddr(VkInstance instance, const char *name)
{ {
void *func; void *func;
...@@ -130,7 +130,7 @@ PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance, const ...@@ -130,7 +130,7 @@ PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance, const
return NULL; return NULL;
} }
PFN_vkVoidFunction WINAPI wine_vkGetDeviceProcAddr(VkDevice device, const char *name) PFN_vkVoidFunction WINAPI vkGetDeviceProcAddr(VkDevice device, const char *name)
{ {
void *func; void *func;
TRACE("%p, %s\n", device, debugstr_a(name)); TRACE("%p, %s\n", device, debugstr_a(name));
...@@ -171,14 +171,14 @@ PFN_vkVoidFunction WINAPI wine_vkGetDeviceProcAddr(VkDevice device, const char * ...@@ -171,14 +171,14 @@ PFN_vkVoidFunction WINAPI wine_vkGetDeviceProcAddr(VkDevice device, const char *
return NULL; return NULL;
} }
void * WINAPI wine_vk_icdGetPhysicalDeviceProcAddr(VkInstance instance, const char *name) void * WINAPI vk_icdGetPhysicalDeviceProcAddr(VkInstance instance, const char *name)
{ {
TRACE("%p, %s\n", instance, debugstr_a(name)); TRACE("%p, %s\n", instance, debugstr_a(name));
return wine_vk_get_phys_dev_proc_addr(name); return wine_vk_get_phys_dev_proc_addr(name);
} }
void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *name) void * WINAPI vk_icdGetInstanceProcAddr(VkInstance instance, const char *name)
{ {
TRACE("%p, %s\n", instance, debugstr_a(name)); TRACE("%p, %s\n", instance, debugstr_a(name));
...@@ -187,10 +187,10 @@ void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *na ...@@ -187,10 +187,10 @@ void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *na
* Vulkan API. One of them in our case should forward to the other, so just forward * Vulkan API. One of them in our case should forward to the other, so just forward
* to the older vkGetInstanceProcAddr. * to the older vkGetInstanceProcAddr.
*/ */
return wine_vkGetInstanceProcAddr(instance, name); return vkGetInstanceProcAddr(instance, name);
} }
VkResult WINAPI wine_vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t *supported_version) VkResult WINAPI vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t *supported_version)
{ {
uint32_t req_version; uint32_t req_version;
...@@ -230,7 +230,7 @@ static BOOL wine_vk_init_once(void) ...@@ -230,7 +230,7 @@ static BOOL wine_vk_init_once(void)
return InitOnceExecuteOnce(&init_once, wine_vk_init, NULL, NULL); return InitOnceExecuteOnce(&init_once, wine_vk_init, NULL, NULL);
} }
VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *create_info, VkResult WINAPI vkCreateInstance(const VkInstanceCreateInfo *create_info,
const VkAllocationCallbacks *allocator, VkInstance *instance) const VkAllocationCallbacks *allocator, VkInstance *instance)
{ {
TRACE("create_info %p, allocator %p, instance %p\n", create_info, allocator, instance); TRACE("create_info %p, allocator %p, instance %p\n", create_info, allocator, instance);
...@@ -241,7 +241,7 @@ VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *create_info, ...@@ -241,7 +241,7 @@ VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *create_info,
return unix_funcs->p_vkCreateInstance(create_info, allocator, instance); return unix_funcs->p_vkCreateInstance(create_info, allocator, instance);
} }
VkResult WINAPI wine_vkEnumerateInstanceExtensionProperties(const char *layer_name, VkResult WINAPI vkEnumerateInstanceExtensionProperties(const char *layer_name,
uint32_t *count, VkExtensionProperties *properties) uint32_t *count, VkExtensionProperties *properties)
{ {
TRACE("%p, %p, %p\n", layer_name, count, properties); TRACE("%p, %p, %p\n", layer_name, count, properties);
...@@ -261,7 +261,7 @@ VkResult WINAPI wine_vkEnumerateInstanceExtensionProperties(const char *layer_na ...@@ -261,7 +261,7 @@ VkResult WINAPI wine_vkEnumerateInstanceExtensionProperties(const char *layer_na
return unix_funcs->p_vkEnumerateInstanceExtensionProperties(layer_name, count, properties); return unix_funcs->p_vkEnumerateInstanceExtensionProperties(layer_name, count, properties);
} }
VkResult WINAPI wine_vkEnumerateInstanceVersion(uint32_t *version) VkResult WINAPI vkEnumerateInstanceVersion(uint32_t *version)
{ {
TRACE("%p\n", version); TRACE("%p\n", version);
...@@ -343,7 +343,7 @@ static void fill_luid_property(VkPhysicalDeviceProperties2 *properties2) ...@@ -343,7 +343,7 @@ static void fill_luid_property(VkPhysicalDeviceProperties2 *properties2)
id->deviceNodeMask); id->deviceNodeMask);
} }
void WINAPI wine_vkGetPhysicalDeviceProperties2(VkPhysicalDevice phys_dev, void WINAPI vkGetPhysicalDeviceProperties2(VkPhysicalDevice phys_dev,
VkPhysicalDeviceProperties2 *properties2) VkPhysicalDeviceProperties2 *properties2)
{ {
TRACE("%p, %p\n", phys_dev, properties2); TRACE("%p, %p\n", phys_dev, properties2);
...@@ -352,7 +352,7 @@ void WINAPI wine_vkGetPhysicalDeviceProperties2(VkPhysicalDevice phys_dev, ...@@ -352,7 +352,7 @@ void WINAPI wine_vkGetPhysicalDeviceProperties2(VkPhysicalDevice phys_dev,
fill_luid_property(properties2); fill_luid_property(properties2);
} }
void WINAPI wine_vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice phys_dev, void WINAPI vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice phys_dev,
VkPhysicalDeviceProperties2 *properties2) VkPhysicalDeviceProperties2 *properties2)
{ {
TRACE("%p, %p\n", phys_dev, properties2); TRACE("%p, %p\n", phys_dev, properties2);
......
...@@ -2500,7 +2500,7 @@ class VkGenerator(object): ...@@ -2500,7 +2500,7 @@ class VkGenerator(object):
f.write("#endif /* __WINE_VULKAN_THUNKS_H */\n") f.write("#endif /* __WINE_VULKAN_THUNKS_H */\n")
def generate_loader_thunks_c(self, f, prefix): def generate_loader_thunks_c(self, f):
self._generate_copyright(f) self._generate_copyright(f)
f.write("#include \"vulkan_loader.h\"\n\n") f.write("#include \"vulkan_loader.h\"\n\n")
...@@ -2513,14 +2513,14 @@ class VkGenerator(object): ...@@ -2513,14 +2513,14 @@ class VkGenerator(object):
if vk_func.loader_thunk_type != ThunkType.PUBLIC: if vk_func.loader_thunk_type != ThunkType.PUBLIC:
continue continue
f.write(vk_func.loader_thunk(prefix=prefix)) f.write(vk_func.loader_thunk())
f.write("static const struct vulkan_func vk_device_dispatch_table[] =\n{\n") f.write("static const struct vulkan_func vk_device_dispatch_table[] =\n{\n")
for vk_func in self.registry.device_funcs: for vk_func in self.registry.device_funcs:
if not vk_func.is_required(): if not vk_func.is_required():
continue continue
f.write(" {{\"{0}\", &{1}{0}}},\n".format(vk_func.name, prefix)) f.write(" {{\"{0}\", &{0}}},\n".format(vk_func.name))
f.write("};\n\n") f.write("};\n\n")
f.write("static const struct vulkan_func vk_phys_dev_dispatch_table[] =\n{\n") f.write("static const struct vulkan_func vk_phys_dev_dispatch_table[] =\n{\n")
...@@ -2528,7 +2528,7 @@ class VkGenerator(object): ...@@ -2528,7 +2528,7 @@ class VkGenerator(object):
if not vk_func.is_required(): if not vk_func.is_required():
continue continue
f.write(" {{\"{0}\", &{1}{0}}},\n".format(vk_func.name, prefix)) f.write(" {{\"{0}\", &{0}}},\n".format(vk_func.name))
f.write("};\n\n") f.write("};\n\n")
f.write("static const struct vulkan_func vk_instance_dispatch_table[] =\n{\n") f.write("static const struct vulkan_func vk_instance_dispatch_table[] =\n{\n")
...@@ -2536,7 +2536,7 @@ class VkGenerator(object): ...@@ -2536,7 +2536,7 @@ class VkGenerator(object):
if not vk_func.is_required(): if not vk_func.is_required():
continue continue
f.write(" {{\"{0}\", &{1}{0}}},\n".format(vk_func.name, prefix)) f.write(" {{\"{0}\", &{0}}},\n".format(vk_func.name))
f.write("};\n\n") f.write("};\n\n")
f.write("void *wine_vk_get_device_proc_addr(const char *name)\n") f.write("void *wine_vk_get_device_proc_addr(const char *name)\n")
...@@ -2581,7 +2581,7 @@ class VkGenerator(object): ...@@ -2581,7 +2581,7 @@ class VkGenerator(object):
f.write(" return NULL;\n") f.write(" return NULL;\n")
f.write("}\n") f.write("}\n")
def generate_loader_thunks_h(self, f, prefix): def generate_loader_thunks_h(self, f):
self._generate_copyright(f) self._generate_copyright(f)
f.write("#ifndef __WINE_VULKAN_LOADER_THUNKS_H\n") f.write("#ifndef __WINE_VULKAN_LOADER_THUNKS_H\n")
...@@ -2598,17 +2598,6 @@ class VkGenerator(object): ...@@ -2598,17 +2598,6 @@ class VkGenerator(object):
f.write(" {0};\n".format(vk_func.pfn(conv=False, call_conv="WINAPI"))) f.write(" {0};\n".format(vk_func.pfn(conv=False, call_conv="WINAPI")))
f.write("};\n\n") f.write("};\n\n")
# 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.is_required():
continue
if vk_func.loader_thunk_type == ThunkType.PUBLIC:
continue
f.write("{0};\n".format(vk_func.prototype("WINAPI", prefix=prefix)))
f.write("\n")
f.write("#endif /* __WINE_VULKAN_LOADER_THUNKS_H */\n") f.write("#endif /* __WINE_VULKAN_LOADER_THUNKS_H */\n")
def generate_vulkan_h(self, f): def generate_vulkan_h(self, f):
...@@ -2769,9 +2758,9 @@ class VkGenerator(object): ...@@ -2769,9 +2758,9 @@ class VkGenerator(object):
def generate_vulkan_spec(self, f): def generate_vulkan_spec(self, f):
self._generate_copyright(f, spec_file=True) self._generate_copyright(f, spec_file=True)
f.write("@ stdcall -private vk_icdGetInstanceProcAddr(ptr str) wine_vk_icdGetInstanceProcAddr\n") f.write("@ stdcall -private vk_icdGetInstanceProcAddr(ptr str)\n")
f.write("@ stdcall -private vk_icdGetPhysicalDeviceProcAddr(ptr str) wine_vk_icdGetPhysicalDeviceProcAddr\n") f.write("@ stdcall -private vk_icdGetPhysicalDeviceProcAddr(ptr str)\n")
f.write("@ stdcall -private vk_icdNegotiateLoaderICDInterfaceVersion(ptr) wine_vk_icdNegotiateLoaderICDInterfaceVersion\n") f.write("@ stdcall -private vk_icdNegotiateLoaderICDInterfaceVersion(ptr)\n")
# Export symbols for all Vulkan Core functions. # Export symbols for all Vulkan Core functions.
for func in self.registry.funcs.values(): for func in self.registry.funcs.values():
...@@ -2781,7 +2770,7 @@ class VkGenerator(object): ...@@ -2781,7 +2770,7 @@ class VkGenerator(object):
# We support all Core functions except for VK_KHR_display* APIs. # We support all Core functions except for VK_KHR_display* APIs.
# Create stubs for unsupported Core functions. # Create stubs for unsupported Core functions.
if func.is_required(): if func.is_required():
f.write(func.spec(prefix="wine_")) f.write(func.spec())
else: else:
f.write("@ stub {0}\n".format(func.name)) f.write("@ stub {0}\n".format(func.name))
...@@ -2799,7 +2788,7 @@ class VkGenerator(object): ...@@ -2799,7 +2788,7 @@ class VkGenerator(object):
# We support all Core functions except for VK_KHR_display* APIs. # We support all Core functions except for VK_KHR_display* APIs.
# Create stubs for unsupported Core functions. # Create stubs for unsupported Core functions.
if func.is_required(): if func.is_required():
f.write(func.spec(symbol="winevulkan.wine_" + func.name)) f.write(func.spec(symbol="winevulkan." + func.name))
else: else:
f.write("@ stub {0}\n".format(func.name)) f.write("@ stub {0}\n".format(func.name))
...@@ -3430,10 +3419,10 @@ def main(): ...@@ -3430,10 +3419,10 @@ def main():
generator.generate_thunks_c(f, "unix_") generator.generate_thunks_c(f, "unix_")
with open(WINE_VULKAN_LOADER_THUNKS_H, "w") as f: with open(WINE_VULKAN_LOADER_THUNKS_H, "w") as f:
generator.generate_loader_thunks_h(f, "wine_") generator.generate_loader_thunks_h(f)
with open(WINE_VULKAN_LOADER_THUNKS_C, "w") as f: with open(WINE_VULKAN_LOADER_THUNKS_C, "w") as f:
generator.generate_loader_thunks_c(f, "wine_") generator.generate_loader_thunks_c(f)
with open(WINE_VULKAN_JSON, "w") as f: with open(WINE_VULKAN_JSON, "w") as f:
generate_vulkan_json(f) generate_vulkan_json(f)
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
#define __WINE_VULKAN_LOADER_H #define __WINE_VULKAN_LOADER_H
#include "wine/debug.h" #include "wine/debug.h"
#define VK_NO_PROTOTYPES
#include "wine/vulkan.h" #include "wine/vulkan.h"
#include "wine/vulkan_driver.h" #include "wine/vulkan_driver.h"
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#if defined(__i386__) #if defined(__i386__)
#define USE_STRUCT_CONVERSION #define USE_STRUCT_CONVERSION
#endif #endif
#define VK_NO_PROTOTYPES
#include <pthread.h> #include <pthread.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment