Compiling Vulkan shaders at runtime
Before we can start working with Vulkan, it’s important to speed up the iterative process of writing shaders. Vulkan uses shaders in the binary form called Standard Portable Intermediate Representation, known as SPIR-V, and typically relies on a standalone shader compiler to precompile shaders offline. While this is ideal for a released product, it can slow down early stages of development and rapid prototyping, where shaders are frequently changed and need to be recompiled with every run. In this recipe, we’ll show you how to compile Vulkan shaders at runtime using Khronos’ reference shader compiler glslang.
Getting ready
Our application is using LightweightVK which is statically linked to the glslang shader compiler. The compiler version used in this recipe was downloaded using the following Bootstrap snippet.
{
"name": "glslang",
"source": {
"type": "git"...