mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 15:58:05 +02:00
vulkan: Support 32-bit "weak" symbols on MSVC
MSVC uses different decorated names for 32-bit versus 64-bit. Declare all argument sizes for 32-bit because computing the actual size would be difficult. Fixes:9be7aa3fc8("vulkan: Add a common entrypoint table generator") Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Acked-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10573> (cherry picked from commitfb7be7870c)
This commit is contained in:
parent
791ef86daa
commit
ffdbd58d58
2 changed files with 12 additions and 4 deletions
|
|
@ -328,7 +328,7 @@
|
|||
"description": "vulkan: Support 32-bit \"weak\" symbols on MSVC",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "9be7aa3fc83ba3117bae7907765fdf2023c2683b"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -109,6 +109,10 @@ TEMPLATE_C = Template(COPYRIGHT + """
|
|||
/* Weak aliases for all potential implementations. These will resolve to
|
||||
* NULL if they're not defined, which lets the resolve_entrypoint() function
|
||||
* either pick the correct entry point.
|
||||
*
|
||||
* MSVC uses different decorated names for 32-bit versus 64-bit. Declare
|
||||
* all argument sizes for 32-bit because computing the actual size would be
|
||||
* difficult.
|
||||
*/
|
||||
|
||||
<%def name="entrypoint_table(type, entrypoints, prefixes)">
|
||||
|
|
@ -119,10 +123,14 @@ TEMPLATE_C = Template(COPYRIGHT + """
|
|||
% endif
|
||||
% for p in prefixes:
|
||||
#ifdef _MSC_VER
|
||||
#pragma comment(linker, "/alternatename:${p}_${e.name}_Weak=${p}_${e.name}_Null")
|
||||
#pragma comment(linker, "/alternatename:${p}_${e.name}=${p}_${e.name}_Weak")
|
||||
${e.return_type} (*${p}_${e.name}_Null)(${e.decl_params()}) = 0;
|
||||
${e.return_type} ${p}_${e.name}_Weak(${e.decl_params()});
|
||||
#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}=_${p}_${e.name}_Null")
|
||||
% endfor
|
||||
#else
|
||||
#pragma comment(linker, "/alternatename:${p}_${e.name}=${p}_${e.name}_Null")
|
||||
#endif
|
||||
#else
|
||||
VKAPI_ATTR ${e.return_type} VKAPI_CALL ${p}_${e.name}(${e.decl_params()}) __attribute__ ((weak));
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue