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:
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
@@ -25,13 +25,13 @@
diff --git a/src/vulkan/overlay-layer/vk_layer_table.cpp b/src/vulkan/overlay-layer/vk_layer_table.cpp
index 4a033b9add6..f5865fa3a6f 100644
@@ -19,7 +19,7 @@
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
@@ -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
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.
it looks like the expected correct usage for these headers is <vulkan/*.h>
Fixed by :
Author: Lionel Landwerlin <email@example.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 <firstname.lastname@example.org>
Acked-by: Eric Engestrom <email@example.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
The next issue seems to be the .so gets installed into:
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:
> 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.