Mesa (master): lavapipe: add dll definition file instead of using PUBLIC

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 23 08:07:02 UTC 2021


Module: Mesa
Branch: master
Commit: 34ed5e4e601187a18d8b59ea5dbdc96de0bbdf21
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=34ed5e4e601187a18d8b59ea5dbdc96de0bbdf21

Author: Dave Airlie <airlied at redhat.com>
Date:   Sun Feb 21 17:27:20 2021 -0800

lavapipe: add dll definition file instead of using PUBLIC

This avoids conflicts with the definitions in vk_icd.h

Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9208>

---

 src/gallium/frontends/lavapipe/lvp_device.c | 6 ++++++
 src/gallium/targets/lavapipe/meson.build    | 1 +
 src/gallium/targets/lavapipe/vulkan_lvp.def | 4 ++++
 3 files changed, 11 insertions(+)

diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c
index af130be3c69..67550bcfee7 100644
--- a/src/gallium/frontends/lavapipe/lvp_device.c
+++ b/src/gallium/frontends/lavapipe/lvp_device.c
@@ -711,6 +711,12 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL lvp_GetInstanceProcAddr(
                                     pName);
 }
 
+/* Windows will use a dll definition file to avoid build errors. */
+#ifdef _WIN32
+#undef PUBLIC
+#define PUBLIC
+#endif
+
 /* The loader wants us to expose a second GetInstanceProcAddr function
  * to work around certain LD_PRELOAD issues seen in apps.
  */
diff --git a/src/gallium/targets/lavapipe/meson.build b/src/gallium/targets/lavapipe/meson.build
index d64f7606412..55c227d5e40 100644
--- a/src/gallium/targets/lavapipe/meson.build
+++ b/src/gallium/targets/lavapipe/meson.build
@@ -1,6 +1,7 @@
 libvulkan_lvp = shared_library(
   'vulkan_lvp',
   [ 'target.c' ],
+  vs_module_defs : 'vulkan_lvp.def',
   include_directories : [ inc_src, inc_util, inc_include, inc_gallium, inc_gallium_aux, inc_gallium_winsys, inc_gallium_drivers ],
   link_whole : [ liblavapipe_st ],
   link_with : [libpipe_loader_static, libgallium, libwsw, libswdri, libws_null, libswkmsdri ],
diff --git a/src/gallium/targets/lavapipe/vulkan_lvp.def b/src/gallium/targets/lavapipe/vulkan_lvp.def
new file mode 100644
index 00000000000..64a9caae593
--- /dev/null
+++ b/src/gallium/targets/lavapipe/vulkan_lvp.def
@@ -0,0 +1,4 @@
+EXPORTS
+vk_icdNegotiateLoaderICDInterfaceVersion
+vk_icdGetInstanceProcAddr
+vk_icdGetPhysicalDeviceProcAddr



More information about the mesa-commit mailing list