It’s finally here. Khronos just made the Unified Vulkan Samples repository publicly available.
For more details see the official press release.
About
The goal of this project is a central source for high-quality Vulkan samples, with contributions both from Khronos members as well as external contributors like me.
It also comes with an extensive framework that takes care of platform-related stuff like window and input handling and offers functionality for loading assets like glTF models, shaders, etc. So if you want to contribute, you can get the base for a new sample up and running within an matter of minutes.
Another benefit of a repository being officially run by the Vulkan Working Group is having developers from different IHVs and ISVs around that’ll take a look at your samples, providing you with feedback on how to get code running and performing well on all the different implementations. This is very valuable and actually resulted in several important fixes and improvements to my own samples.
Also in place is an in-depth review-process, making sure that all samples are up-to-par before finding their way into the repository. This ensures a high quality standard for all samples to be found in this repository, which will hopefully make it a great resource for those looking after Vulkan samples.
My contributions
The initial selection of samples ported over:
- High-dynamic range
- Terrain tessellation
- Basic texture loading (KTX)
- Conditional rendering (EXT)
- Basic nv ray tracing (NV)
- Push descriptors (KHR)
- Compute shader n-body simulation
- Instancing
- Dynamic uniform buffers
While this may look like a random selection, that’s actually not the case. I wanted to start off with a broad cross-section off all features and functions used in my samples: Loading textures, loading models, post-processing, multi-pass rendering, doing compute and using official Khronos as vell as vendor-specific extensions.
Those samples were then used to enhance the unified framework and to define a workflow for adding new samples to the repository.
In the next weeks and months I’ll start porting more of my samples over to the unified repository. My current repository will remain though, as not all samples are a good fit for the unified samples, and I may want to do new samples that would not fit into the new repository.
Differences
For those that are familar with my Vulkan samples, here are some of the key differences:
There is a fully-fledged framework
While the basecode from my current Samples could be considered a framework, it’s mostly tailored to my needs. The new repository includes an extensive framework provided by ARM, making the process of writing new samples a lot easier. The new framework takes away most of the boilerplate that you’d otherwise have to deal with and allows you to concentrate on the actual Vulkan functionality you want do demonstrate. To get you started, there is a contribution guide in the repository.
Samples are no longer standalone
Unlike with my repository, the samples are now longer stand-alone and instead a launcher application is used. This makes redistribution a bit easier, and there is now a nice launcher for Android that let’s you select and start all samples from a single app.
Validation is a build-time setting
Validaiton is no longer enabled via command-line, but rather via a CMake toggle. So if you need to run with validation layers enabled, make sure to tick the VKB_VALIDATION_LAYERS
box in CMake.
Assets are stored in a separate repository
To keep the actual repository clean, assets are tracked in a separate repository. This is included as a shallow submodule, so only the latest revision is checked out. No need to manually run a download script for getting assets.