add vkgears demo
Mesa has had Vulkan support for many years now, and so far no Vulkan demos! This needs to change!
So here's a Vulkan port of the gears demo, with a bunch of limitations:
- Only Wayland support. The WSI code is more or less separated out, and it should be possible to support X11 as well. But I haven't done that work yet, and I'm a bit unsure if this is the right approach or not. More below.
- No support for MSAA. It's not hard to add or anything, just some more typing.
- No fullscreen support. Again, not hard to add, just typing.
- No swap-interval support, hard-coded vsync off for now. Again, just typing needed.
- No support for non gamma-correct rendering. There's no reason to not always do sRGB on Vulkan IMO. Lighting in gamma space is not great.
- No support for stereo rendering (e.g multiview). I don't have hardware to test this, and even if I had it would be pretty far down on my list of things to add.
- No keyboard input.
I think the biggest question mark here is if doing manual WSI like I've done for Wayland here is a good idea in the first place. I was kinda following glxgears precedence here, but I'm not sure it's the right thing to do. I could imagine using either SDL or GLFW here would make things a bit easier to maintain... but it'd also pull in some non-trivial dependencies.
I don't really want to create sepatate vkgears_wayland
/ vkgears_x11
binaries like we do for es2gears
, that just seems messy to me. If so, it's be better to do similar to vkcube does, and either pick API automatically, or explicitly based on a command line switch.
Thoughts?
This MR contains a few patches from !92 (merged). Please review those in that MR, because I want to land that one first.