The goal of this library is to provide easy to integrate solution for creation and storage of Vulkan shader modules.
This library exposes single class capable of loading shaders from hard drive, compiling them on the fly, and facilitating efficient querying of previously loaded shaders. Moreover, it supports hot reloading of shaders during runtime, enabling seamless updates and modifications.
Both of them are shipped together with Vulkan SDK.
Copy the shader-stash.hpp header file into your project and link to the shaderc_shared library which can be found in the {VulkanSDK}/{SDK Version}/Lib folder.
#include "shader-stash.hpp"
ShaderStash shaders {vulkanDevice, "/shaders"};
shaders.add("example_shader.vert");
shaders.add("/other_shaders");
// or using method chaining:
shaders
.add("example_shader.vert")
.add("/other_shaders");
shaders.setHotReload(true);
std::shared_ptr<vk::raii::ShaderModule> exampleShader = shaders.get("example_shader.vert");
- Shader runtime compilation
- Shader hot reload
- Shader change callbacks