You have to get the Vulkan SDK from https://vulkan.lunarg.com/ and have it installed. CMake will find it automatically only when the VULKAN_SDK
environmental variable is set correctly.
You will also need Vulkan drivers 1.2 or newer.
Sponza scene is required for the default example and can be downloaded here, from the Intel GPU Research samples. After you download it, provide the path to it in the main.cpp file.
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug
orcmake -DCMAKE_BUILD_TYPE=Release
- Use the specified generator (e.g. make, visual studio, ninja, etc...)
Open the project's directory, your IDE will handle it and configure CMake accordingly. You can use your own configurations.
Place all of your shaders in the src/renderer/shaders
directory. Only there the shaders will get automatically compiled and copied correctly.
CMake will generate custom shader build-and-copy commands for each GLSL source file everytime you reload or create the CMake project (cmake
command).
The commands are always executed during the build process only for the sources that changed compared to the last compiled version (Or if a re-build was issued). Each compiled .spv
file will get copied into the shaders/
directory located in the target build directory while maintaining the file structure (e.g. shaders in subdirectories).
Use GLSL to SPIR-V compiler like glslangValidator
or glslc
on each shader source file.
On Windows you can run the compile.bat
script located in the src/renderer/shaders
directory.
Copy the resulting .spv
files manually to the shaders/
directory located in the target build directory.