From 45a9fd6acb58b6971c40077a52205ae02cf6ad63 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 14 Oct 2021 10:34:37 +0200 Subject: [PATCH] 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 Reviewed-by: Jesse Natalie Part-of: (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 79bb04d5f8b..9a393bca23b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1786,7 +1786,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 509a246edc2..d07d5120d1e 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 b4a8985c1a3..2c234911b24 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