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: 6d44b21d4f ("vulkan: Fix weak symbol emulation when compiling with MSVC")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13516>
This commit is contained in:
Boris Brezillon 2021-10-25 18:37:21 +02:00 committed by Marge Bot
parent b7c7abded7
commit 1813bb5917
2 changed files with 3 additions and 3 deletions

View file

@ -69,7 +69,7 @@ extern "C" {
#endif
#ifdef _MSC_VER
void vk_entrypoint_stub(void);
VKAPI_ATTR void VKAPI_CALL vk_entrypoint_stub(void);
#endif
<%def name="dispatch_table(entrypoints)">
@ -469,7 +469,7 @@ vk_device_entrypoint_is_enabled(int index, uint32_t core_version,
}
#ifdef _MSC_VER
void vk_entrypoint_stub(void)
VKAPI_ATTR void VKAPI_CALL vk_entrypoint_stub(void)
{
unreachable(!"Entrypoint not implemented");
}

View file

@ -125,7 +125,7 @@ TEMPLATE_C = Template(COPYRIGHT + """
#ifdef _MSC_VER
#ifdef _M_IX86
% 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
#else
#pragma comment(linker, "/alternatename:${p}_${e.name}=vk_entrypoint_stub")