From fd467492349ee32cd196a8bd747269404965e3b1 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: --- src/vulkan/util/vk_dispatch_table_gen.py | 4 ++++ src/vulkan/util/vk_entrypoints_gen.py | 2 ++ 2 files changed, 6 insertions(+) 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