vulkan: Fix weak symbol emulation when compiling with MSVC
authorBoris Brezillon <boris.brezillon@collabora.com>
Wed, 13 Oct 2021 19:50:59 +0000 (21:50 +0200)
committerBoris Brezillon <boris.brezillon@collabora.com>
Thu, 14 Oct 2021 07:09:23 +0000 (09:09 +0200)
commit6d44b21d4fdea89673541de265f69258747c5499
treef937a6b2766d90245453c7ef6c33a16014371cb6
parentae99ea6f4ddb90f7120b4986709a9e9064037f94
vulkan: Fix weak symbol emulation when compiling with MSVC

Mapping unimplemented entrypoints to a global function pointer variable
initialized to NULL is a bit cumbersome, and actually led to a bug
in the vk_xxx_dispatch_table_from_entrypoints() template: the !override
case didn't have the right check on the source table entries. Instead of
fixing that case, let's simplify the logic by creating a stub function
and making the alternatename pragma point to this stub. This way we get
rid of all those uneeded xxx_Null symbols/variables and simplify the
tests in vk_xxxx_dispatch_table_from_entrypoints().

Cc: mesa-stable
Fixes: 98c622a96e28 ("vulkan: Update dispatch table gen for Windows")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13348>
src/vulkan/util/vk_dispatch_table_gen.py
src/vulkan/util/vk_entrypoints_gen.py