I tried building Mesa master on Debian testing, enabling vulkan-overlay-layer, and it failed because of mismatching includes. I installed glslang-tools vulkan-validationlayers-dev and enabled the option: -Dvulkan-overlay-layer=true I had to modify includes like this, to make it build: diff --git a/src/vulkan/overlay-layer/overlay.cpp b/src/vulkan/overlay-layer/overlay.cpp index f3678198b00..4b8010ba003 100644 --- a/src/vulkan/overlay-layer/overlay.cpp +++ b/src/vulkan/overlay-layer/overlay.cpp @@ -25,13 +25,13 @@ #include <stdlib.h> #include <assert.h> -#include <vk_loader_platform.h> +#include <vulkan/vk_loader_platform.h> #include <vulkan/vulkan.h> -#include <vk_dispatch_table_helper.h> +#include <vulkan/vk_dispatch_table_helper.h> #include <vulkan/vk_layer.h> -#include "vk_layer_data.h" +#include "vulkan/vk_layer_data.h" #include "vk_layer_table.h" -#include "vk_layer_extension_utils.h" +#include "vulkan/vk_layer_extension_utils.h" #include "imgui.h" diff --git a/src/vulkan/overlay-layer/vk_layer_table.cpp b/src/vulkan/overlay-layer/vk_layer_table.cpp index 4a033b9add6..f5865fa3a6f 100644 --- a/src/vulkan/overlay-layer/vk_layer_table.cpp +++ b/src/vulkan/overlay-layer/vk_layer_table.cpp @@ -19,7 +19,7 @@ */ #include <assert.h> #include <unordered_map> -#include "vk_dispatch_table_helper.h" +#include "vulkan/vk_dispatch_table_helper.h" #include "vulkan/vk_layer.h" #include "vk_layer_table.h" static device_table_map tableMap;
Another problem was that ninja install doesn't deploy actual layer .so file. I did this in my build script: DESTDIR="$dest_dir" LC_ALL=C.UTF-8 ninja install It deployed VkLayer_MESA_overlay.json, but missed libVkLayer_MESA_overlay.so.
I had to add this to get the overlay .so deployed: diff --git a/src/vulkan/overlay-layer/meson.build b/src/vulkan/overlay-layer/meson.build index 573983e0438..9d1bc97c131 100644 --- a/src/vulkan/overlay-layer/meson.build +++ b/src/vulkan/overlay-layer/meson.build @@ -48,6 +48,7 @@ vklayer_mesa_overlay = shared_library( link_args : cc.get_supported_link_arguments(['-Wl,-Bsymbolic-functions', '-Wl,-z,relro']), link_with : [libmesa_util, libvulkan_util], install_dir : vklayer_install_dir, + install : true ) also currently the layer won't get build with -D vulkan-drivers='' so you can't build it independently.
It seems like meson.build should add 'inc_vulkan_validation' dev header directory to include_directories or just append 'vulkan/' for each header used from there.
On the install : true, I was told to remove it. Not being a meson expert but I can definitely put it back. On the header files of the loader/validation-layers, I have the headers installed in a different directory because of a compile option of the loader. I should probably go with the same options as debian.
Uploaded https://gitlab.freedesktop.org/mesa/mesa/merge_requests/293
From https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/729#issuecomment-467162536 it looks like the expected correct usage for these headers is <vulkan/*.h>
Fixed by : commit 964675082231963816a60271390bd04d561888fd Author: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Date: Fri Feb 22 12:54:53 2019 +0000 vulkan/overlay: fix includes The Loader/Validation-Layers repository allow the user to choose where header files are installed. On my system I choose /usr/include thinking it was the obvious "base" location, but it turns out the headers end up being installed right there rather in a vulkan subdirectory. On Debian/Ubuntu the selected installation path is /usr/include/vulkan, so just go with that. Hopefully other distro don't choose another path. Note that the validation layer doesn't provide a .pc file so we have no way of querying where the headers are installed. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109739 Acked-by: Eric Engestrom <eric.engestrom@intel.com>
On Gentoo it installs into /usr/include :(
(In reply to Mike Lothian from comment #8) > On Gentoo it installs into /usr/include :( According to upstream, that's something distributions should fix. You can open a Gentoo bug.
I've created a merge request to get the vulkan-layers headers put into the correct place https://github.com/gentoo/gentoo/pull/11166 The next issue seems to be the .so gets installed into: /usr/share/vulkan/explicit_layer.d/libVkLayer_MESA_overlay.so In gentoo the .so files get installed into /usr/lib and /usr/lib64 with only the json files being installed into /usr/share/vulkan/explicit_layer.d/ This allows both 32bit and 64bit to coexist
(In reply to Mike Lothian from comment #10) > The next issue seems to be the .so gets installed into: > > /usr/share/vulkan/explicit_layer.d/libVkLayer_MESA_overlay.so > > In gentoo the .so files get installed into /usr/lib and /usr/lib64 with only > the json files being installed into /usr/share/vulkan/explicit_layer.d/ > > This allows both 32bit and 64bit to coexist Yes, looks like it's not supporting multilib case in the current Meson configuration. JSON should probably include arch and .so should be placed accordingly. Can you please open a separate bug for it though, since it's not related to the issue in the current bug.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.