Skip to content

Draft: clients/simple-vulkan: New Vulkan client example

Erico Nunes requested to merge enunes/weston:simple-vulkan into main

I kind of wanted a simple, available and pure-Wayland Vulkan client to test Vulkan working in new hardware/driver enablement etc, just like there is weston-simple-egl. Then it would also be nice bonus if the source for it is easy to read, focusing on the Wayland use without many layers of abstractions or having to jump through several WSI backends (such as vkcube etc) while reading the code. I like weston-simple-egl for that so I took as an exercise to try to port it into a Vulkan client, initially for my own use. It turned out to be not terribly larger than simple-egl.c in lines of code, even with the added verboseness of Vulkan.

At this point I'm not sure if there is interest in weston upstream in this so I'm submitting originally as a Draft. Is there interest in weston upstream in including this?

If so then we may continue to clean this up and I can use some review. I'm not really experienced writing Vulkan applications so I borrowed from the vkcube and mesa-demos implementations. For now I focused mostly in reproducing the same spinning triangle, and keeping the code similar to simple-egl.c (so much that it is actually still meaningful to diff them and see what is changed for Vulkan). So a lot of code is duplicated, but for now I intentionally left it like that for a single source read rather than a new shared library of code which would make both slightly more complicated to follow. We could change that of course if there is interest. For Vulkan I mostly kept the boilerplate borrowed code and added features such as choosing the presentation mode and the opaque switch.

Merge request reports