Mesa (main): vulkan: Set unused entrypoints to vk_entrypoint_stub when compiling with MSVC
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Oct 14 14:17:05 UTC 2021
Module: Mesa
Branch: main
Commit: fd467492349ee32cd196a8bd747269404965e3b1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fd467492349ee32cd196a8bd747269404965e3b1
Author: Boris Brezillon <boris.brezillon at collabora.com>
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 <boris.brezillon at collabora.com>
Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13355>
---
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
More information about the mesa-commit
mailing list