You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
only cotains guide for X Window System. And what about Wayland? I suggest adding another section for it, but this may be not so easy, because as far as I know Wayland support in Vulkan is a new feature.
It has been working right away with Wayland provided. Just have glfw-wayland installed and you should be good to go; after all glfw handles all the window-related stuff
Issue #2 -
The initial VulkanTest does not create a Window instance on Wayland, and after much confusion I found on a GLFW/Wayland issue (glfw/glfw#1398 (comment)) that
".. by design. A Wayland window is not shown until a buffer is commited. If consistency is desired here, GLFW could clear the surface to black and commit it when the surface is created." - jjagg
Solution:
A slight difference in the way files should be linked for Vulkan to work with Wayland, and an explanation about the Wayland/GLFW buffer creation could be specified in the Vulkan-tutorial linked above, to help offer some clarity for future wayland users.
I ran into the same problem and came up with a different but similar solution to the GLFW link problem; the one above would probably not work for me anyway, since there is no glfw.so file in /usr/include/vulkan on my system apparently, which I could link with.
What I did was download the glfw sources from its website, and compile it with wayland support :
Then I copied the resulting libglfw.so, libglfw.so.3 and libglfw.so.3.3 files into my project files, and used the -L and LD_LIBRARY_PATH to compile and run the example, like in alephpt's solution above (pointing to my local project binaries of course).
Activity
Overv commentedon Apr 28, 2019
I will include it once Wayland is no longer an experimental feature in GLFW (https://www.glfw.org/docs/latest/news.html#news_31_wayland).
Tooniis commentedon May 31, 2020
It has been working right away with Wayland provided. Just have
glfw-waylandinstalled and you should be good to go; after all glfw handles all the window-related stuffalephpt commentedon Aug 7, 2021
Update on this issue after some trouble-shooting and trial and error...
Issue #1 -
https://vulkan-tutorial.com/Development_environment#page_Setting-up-a-makefile-project is geared towards X11
Wayland does support x11 with xorg-xwayland, but you cannot install and link against glfw-x11 and have glfw-wayland installed side by side due to packaging conflicts (at least on arch).
Issue #2 -
The initial VulkanTest does not create a Window instance on Wayland, and after much confusion I found on a GLFW/Wayland issue (glfw/glfw#1398 (comment)) that
".. by design. A Wayland window is not shown until a buffer is commited. If consistency is desired here, GLFW could clear the surface to black and commit it when the surface is created." - jjagg
Solution:
A slight difference in the way files should be linked for Vulkan to work with Wayland, and an explanation about the Wayland/GLFW buffer creation could be specified in the Vulkan-tutorial linked above, to help offer some clarity for future wayland users.
Here is the Makefile config I found to work:
graslany commentedon Nov 23, 2022
I ran into the same problem and came up with a different but similar solution to the GLFW link problem; the one above would probably not work for me anyway, since there is no glfw.so file in /usr/include/vulkan on my system apparently, which I could link with.
What I did was download the glfw sources from its website, and compile it with wayland support :
Then I copied the resulting libglfw.so, libglfw.so.3 and libglfw.so.3.3 files into my project files, and used the
-LandLD_LIBRARY_PATHto compile and run the example, like in alephpt's solution above (pointing to my local project binaries of course).graslany commentedon Nov 23, 2022
One interesting thing though : the GLFW binary on my system (Fedora 36) has X11 support only, apparently :
However, the one I just compiled seems to have support for both :
I wonder why the maintainers for Fedora only included one of them...