Skip to content
Snippets Groups Projects
Commit 1813bb59 authored by Boris Brezillon's avatar Boris Brezillon Committed by Marge Bot
Browse files

vulkan: Fix entrypoint generation when compiling for x86 with MSVC


When compiling for x86 with MSVC, Vulkan API entry points follow the
__stdcall convention (VKAPI_CALL maps to __stdcall), which uses the
following name mangling:

   _<function_name>@<arguments_size>

Fix the vk_entrypoint_stub()/alternatename definitions accordingly.

Fixes: 6d44b21d ("vulkan: Fix weak symbol emulation when compiling with MSVC")
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie's avatarJesse Natalie <jenatali@microsoft.com>
Part-of: <mesa/mesa!13516>
parent b7c7abde
No related branches found
No related tags found
No related merge requests found
...@@ -69,7 +69,7 @@ extern "C" { ...@@ -69,7 +69,7 @@ extern "C" {
#endif #endif
#ifdef _MSC_VER #ifdef _MSC_VER
void vk_entrypoint_stub(void); VKAPI_ATTR void VKAPI_CALL vk_entrypoint_stub(void);
#endif #endif
<%def name="dispatch_table(entrypoints)"> <%def name="dispatch_table(entrypoints)">
...@@ -469,7 +469,7 @@ vk_device_entrypoint_is_enabled(int index, uint32_t core_version, ...@@ -469,7 +469,7 @@ vk_device_entrypoint_is_enabled(int index, uint32_t core_version,
} }
#ifdef _MSC_VER #ifdef _MSC_VER
void vk_entrypoint_stub(void) VKAPI_ATTR void VKAPI_CALL vk_entrypoint_stub(void)
{ {
unreachable(!"Entrypoint not implemented"); unreachable(!"Entrypoint not implemented");
} }
......
...@@ -125,7 +125,7 @@ TEMPLATE_C = Template(COPYRIGHT + """ ...@@ -125,7 +125,7 @@ TEMPLATE_C = Template(COPYRIGHT + """
#ifdef _MSC_VER #ifdef _MSC_VER
#ifdef _M_IX86 #ifdef _M_IX86
% for args_size in [4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 60, 104]: % for args_size in [4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 60, 104]:
#pragma comment(linker, "/alternatename:_${p}_${e.name}@${args_size}=_vk_entrypoint_stub") #pragma comment(linker, "/alternatename:_${p}_${e.name}@${args_size}=_vk_entrypoint_stub@0")
% endfor % endfor
#else #else
#pragma comment(linker, "/alternatename:${p}_${e.name}=vk_entrypoint_stub") #pragma comment(linker, "/alternatename:${p}_${e.name}=vk_entrypoint_stub")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment