Skip to content
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

Is vkvg Wayland-native like Cairo-gl? #58

Open
Rubo3 opened this issue Jan 21, 2022 · 12 comments
Open

Is vkvg Wayland-native like Cairo-gl? #58

Rubo3 opened this issue Jan 21, 2022 · 12 comments

Comments

@Rubo3
Copy link
Contributor

Rubo3 commented Jan 21, 2022

You can make Cairo-gl Wayland-native thanks to its EGL backend, as shown here: https://jan.newmarch.name/Wayland/Cairo. Can you do the same with vkvg?

@jpbruyere
Copy link
Owner

https://www.phoronix.com/scan.php?page=news_item&px=Vulkan-Wayland-Compositor-Near : there are some efforts to make vulan-wayland bridges, this should pose no problems to create a wayland surface with vkvg, it's surely a good task to put on the roadmap...

@Rubo3
Copy link
Contributor Author

Rubo3 commented Jan 22, 2022

Thanks, it's great to see that! However I was talking about Wayland clients, I saw in this Reddit thread https://www.reddit.com/r/vulkan/comments/gs8wy7/vulkan_and_egl/fsk0d8d that it seems to be possible to draw with Vulkan on Wayland surfaces without EGL, here is some code https://github.com/krOoze/Hello_Triangle/blob/master/src/WSI/Wayland.h

@jpbruyere
Copy link
Owner

jpbruyere commented Jan 24, 2022

I've made some test on wayland today, and there is no problem, and it's quiet faster than under X. Maybe weston will become my first desktop env...
GLFW handles natively wayland...

@Rubo3
Copy link
Contributor Author

Rubo3 commented Jan 24, 2022

I've made some test on wayland today, and there is no problem, and it's quiet faster than under X.

True, I ran some tests too. Now I'm studying what can be ported from vkh to vkvg to mimic the behaviour of cairo-gl. I see your tests/common/test.c and tests/common/vkengine.c are quite useful to understand the structure of a program which draws to an on-screen surface. It's quite simpler than Vulkan's HelloTriangle haha.

GLFW handles natively wayland...

Yeah it's amazing, I didn't even have to recompile or link against Wayland.

@jpbruyere
Copy link
Owner

jpbruyere commented Jan 24, 2022

I've not included vkengine in vkh because of glfw dependancy, but I use it everywhere. Maybe I should include it to vkh and add a build option. Or maybe make a separate git repo for vkengine and build it with cmake as an object library...

@Rubo3
Copy link
Contributor Author

Rubo3 commented Jan 27, 2022

Maybe I should include it to vkh and add a build option.

What about integrating it to vkh and adding a build option to include the GLFW-dependent code?

@jpbruyere
Copy link
Owner

Yes, it would be better than to copy vkengine.* each time I start a vulkan app.

@tmathews
Copy link

tmathews commented Jul 3, 2024

Perhaps we can do it without GLFW using the technique described here: https://amini-allight.org/post/using-wayland-with-vulkan. It looks like it would be a lot more work? But this is something that I'll be investigating for my own projects as I don't use GLFW, but my own wrapper for Wayland protocols. To me this is advantageous as it offers me more control for my applications.

@jpbruyere
Copy link
Owner

jpbruyere commented Jul 3, 2024

From the point of view of vkvg, only vulkan context objects (Application, devices, queue) are required. Having an application launched under wayland looks straightforward with your link.

https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#platformCreateSurface_wayland

Creating a valid vulkan surface with VK_KHR_wayland_surface instance extension is the only point of interest from the point of view if vkvg.

@tmathews
Copy link

tmathews commented Jul 3, 2024

Thanks for pointing this out. I will try to get a working example for my purposes. Would it be ideal to have this kind of example in vkvg for demonstration purposes?

@jpbruyere
Copy link
Owner

Sure it would be great to have a working example!

@tmathews
Copy link

I'm happy to say I finally got something working: https://github.com/tmathews/wayland-vulkan-vkvg. There are a lot of errors at the moment and it's very messy, I hacked until I sort of understood what was happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants