Mesa (main): vulkan/wsi: Add a dispatch table for WSI entrypoints
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Oct 13 00:36:58 UTC 2021
Module: Mesa
Branch: main
Commit: 020fbb9ea1872857076a2c204958d2031bd590f1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=020fbb9ea1872857076a2c204958d2031bd590f1
Author: Jason Ekstrand <jason at jlekstrand.net>
Date: Wed Oct 6 09:37:32 2021 -0500
vulkan/wsi: Add a dispatch table for WSI entrypoints
Acked-by: Chia-I Wu <olvaffe at gmail.com>
Acked-by: Iago Toral Quiroga <itoral at igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13234>
---
src/vulkan/wsi/meson.build | 37 +++++++++++++++++++++++++++++++------
src/vulkan/wsi/wsi_common.h | 7 +++++++
2 files changed, 38 insertions(+), 6 deletions(-)
diff --git a/src/vulkan/wsi/meson.build b/src/vulkan/wsi/meson.build
index 3b3abf7b815..d2a823a708e 100644
--- a/src/vulkan/wsi/meson.build
+++ b/src/vulkan/wsi/meson.build
@@ -44,11 +44,24 @@ if system_has_kms_drm and not with_platform_android
files_vulkan_wsi += files('wsi_common_display.c')
endif
+wsi_entrypoints = custom_target(
+ 'wsi_entrypoints',
+ input : [vk_entrypoints_gen, vk_api_xml],
+ output : ['wsi_common_entrypoints.h', 'wsi_common_entrypoints.c'],
+ command : [
+ prog_python, '@INPUT0@', '--xml', '@INPUT1@', '--proto', '--weak',
+ '--out-h', '@OUTPUT0@', '--out-c', '@OUTPUT1@', '--prefix', 'wsi',
+ ],
+ depend_files : vk_entrypoints_gen_depend_files,
+)
+
libvulkan_wsi = static_library(
'vulkan_wsi',
- files_vulkan_wsi,
+ [files_vulkan_wsi, wsi_entrypoints],
include_directories : [inc_include, inc_src],
- dependencies : [vulkan_wsi_deps, dep_libdrm, idep_vulkan_util, idep_xmlconfig],
+ dependencies : [
+ vulkan_wsi_deps, dep_libdrm, idep_vulkan_util_headers, idep_xmlconfig,
+ ],
c_args : [vulkan_wsi_args],
gnu_symbol_visibility : 'hidden',
build_by_default : false,
@@ -58,7 +71,19 @@ idep_vulkan_wsi_headers = declare_dependency(
include_directories : include_directories('.')
)
-idep_vulkan_wsi = declare_dependency(
- link_with : libvulkan_wsi,
- dependencies : idep_vulkan_wsi_headers
-)
+# This is likely a bug in the Meson VS backend, as MSVC with ninja works fine.
+# See this discussion here:
+# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10506
+if get_option('backend').startswith('vs')
+ idep_vulkan_wsi = declare_dependency(
+ link_with : libvulkan_wsi,
+ dependencies : idep_vulkan_wsi_headers
+ )
+else
+ idep_vulkan_wsi = declare_dependency(
+ # Instruct users of this library to link with --whole-archive. Otherwise,
+ # our weak function overloads may not resolve properly.
+ link_whole : libvulkan_wsi,
+ dependencies : idep_vulkan_wsi_headers
+ )
+endif
diff --git a/src/vulkan/wsi/wsi_common.h b/src/vulkan/wsi/wsi_common.h
index 473efcc16a4..1b3738f2b3b 100644
--- a/src/vulkan/wsi/wsi_common.h
+++ b/src/vulkan/wsi/wsi_common.h
@@ -27,9 +27,16 @@
#include <stdbool.h>
#include "vk_alloc.h"
+#include "vk_dispatch_table.h"
#include <vulkan/vulkan.h>
#include <vulkan/vk_icd.h>
+#ifndef WSI_ENTRYPOINTS_H
+extern const struct vk_instance_entrypoint_table wsi_instance_entrypoints;
+extern const struct vk_physical_device_entrypoint_table wsi_physical_device_entrypoints;
+extern const struct vk_device_entrypoint_table wsi_device_entrypoints;
+#endif
+
/* This is guaranteed to not collide with anything because it's in the
* VK_KHR_swapchain namespace but not actually used by the extension.
*/
More information about the mesa-commit
mailing list