-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vulkan fail to create swapchain on Wayland (Call to a X11 function ?) #3174
Comments
cc @belegdol |
Did you rebuild glfw with Wayland support enabled? AFAIK for glfw Wayland or X11 is a compile-time option and only one or the other can be built in at any given time. |
Also, on XWayland you should be creating an X11 window I believe. Wayland window is for native Wayland window only. |
Thanks for the fast answere :D! |
Thanks for confirming. I will try to have a look tomorrow. I recall testing this on Nvidia myself and I recall that the examples were working as intended. |
Have you defined WL_EGL_PLATFORM when compiling your code? For some reason the X11 variant of the function is getting called. |
I didn't, so i tried, but it seems WL_EGL_PLATFORM isn't used ? i tried defining it with cmake but it tells me that it is not used. It doesn't change if i define it directly in my code either. same problem. if you can guide me if i did something wrong i would really apreciate it. |
Well if you are building bgfx from source you need to modify the makefile: diff --git a/makefile b/makefile
index 06e6573e1..84af399e4 100644
--- a/makefile
+++ b/makefile
@@ -113,7 +113,7 @@ wasm-release: .build/projects/gmake-wasm ## Build - Emscripten Release
wasm: wasm-debug wasm-release ## Build - Emscripten Debug and Release
.build/projects/gmake-linux:
- $(GENIE) --with-tools --with-combined-examples --with-shared-lib --gcc=linux-gcc gmake
+ $(GENIE) --with-tools --with-combined-examples --with-shared-lib --with-glfw --with-wayland --gcc=linux-gcc gmake
linux-debug64: .build/projects/gmake-linux ## Build - Linux x64 Debug
$(MAKE) -R -C .build/projects/gmake-linux config=debug64
linux-release64: .build/projects/gmake-linux ## Build - Linux x64 Release This ensures that the wayland-specific Vulkan code gets built: Lines 207 to 209 in 17f7730
With this and glfw rebuilt with -DGLFW_USE_WAYLAND=ON added I have vulkan on wayland working on Fedora 38 with 535.xx nvidia drivers: |
It worked, |
Hi, Bgfx with vulkan on wayland with a window created with glfw doesn't seems to work. it work fine with X11 (XWayland) tho.
Here is a minimum example of code that make the bug happens.
It crashes while trying to create the swapchain on bgfx::init, here is the call stack :
The behaviour i was expecting was bgfx initialize successfully.
If it can help : I'm on linux (6.4.12-arch1-1) with a wayland window manager. (with XWayland for compatibility with X11 app)
on CLion, using the bundled cmake that come with CLion.
compiler are gcc/g++.
I use up to date Nvidia proprietary driver.
Hope my english is acceptable.
Edit : I forgot to mention, it work fine with opengl, same setup, same code, but instead of Vulkan type is OpenGL, and it work perfectly with wayland.
The text was updated successfully, but these errors were encountered: