Module: Mesa Branch: staging/21.2 Commit: 2c1bd88f601d3781ee43d7d1e7ab958af6f868f7 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c1bd88f601d3781ee43d7d1e7ab958af6f868f7
Author: Boris Brezillon <[email protected]> Date: Thu Oct 14 10:34:37 2021 +0200 vulkan: Set unused entrypoints to vk_entrypoint_stub when compiling with MSVC If we don't do that we hit the assert(entry[i] != NULL) added by commit 6d44b21d4fd ("vulkan: Fix weak symbol emulation when compiling with MSVC"). Fixes: 6d44b21d4fd ("vulkan: Fix weak symbol emulation when compiling with MSVC") Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Jesse Natalie <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13355> (cherry picked from commit fd467492349ee32cd196a8bd747269404965e3b1) --- .pick_status.json | 2 +- src/vulkan/util/vk_dispatch_table_gen.py | 4 ++++ src/vulkan/util/vk_entrypoints_gen.py | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index ae078a021c8..c4cf67a733c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -58,7 +58,7 @@ "description": "vulkan: Set unused entrypoints to vk_entrypoint_stub when compiling with MSVC", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "6d44b21d4fdea89673541de265f69258747c5499" }, diff --git a/src/vulkan/util/vk_dispatch_table_gen.py b/src/vulkan/util/vk_dispatch_table_gen.py index 87456154832..0567163cf0d 100644 --- a/src/vulkan/util/vk_dispatch_table_gen.py +++ b/src/vulkan/util/vk_dispatch_table_gen.py @@ -68,6 +68,10 @@ TEMPLATE_H = Template(COPYRIGHT + """\ extern "C" { #endif +#ifdef _MSC_VER +void vk_entrypoint_stub(void); +#endif + <%def name="dispatch_table(entrypoints)"> % for e in entrypoints: % if e.alias: diff --git a/src/vulkan/util/vk_entrypoints_gen.py b/src/vulkan/util/vk_entrypoints_gen.py index ee91e1a0c44..70f9ef5a992 100644 --- a/src/vulkan/util/vk_entrypoints_gen.py +++ b/src/vulkan/util/vk_entrypoints_gen.py @@ -148,6 +148,8 @@ const struct vk_${type}_entrypoint_table ${p}_${type}_entrypoints = { % endif .${e.name} = ${p}_${e.name}, % if e.guard is not None: +#elif defined(_MSC_VER) + .${e.name} = (PFN_vkVoidFunction)vk_entrypoint_stub, #endif // ${e.guard} % endif % endfor
