This guide shows you how to generate the Vulkan C++ headers for each host OS from the shader files.
Generate C++ headers from the shader files
Download the Khronos Group Glslang Tool: Candidate of July 26, 2020 on your local machine.
Unzip it.
Check its version:
Windows
bin\glslangValidator --version
macOS
./bin/glslangValidator --version
Linux
./bin/glslangValidator --version
In the Cardboard repository, locate the
sdk/rendering/android/shaders
folder and save its path.Generate the Vulkan header files in C++:
Windows
bin\glslangValidator -V --vn distortion_frag
%SHADERS_FOLDER_PATH% \distortion.frag -o distortion_frag.spv.hbin\glslangValidator -V --vn distortion_vert
%SHADERS_FOLDER_PATH% \distortion.vert -o distortion_vert.spv.hmacOS
./bin/glslangValidator -V --vn distortion_frag
$SHADERS_FOLDER_PATH /distortion.frag -o distortion_frag.spv.h./bin/glslangValidator -V --vn distortion_vert
$SHADERS_FOLDER_PATH /distortion.vert -o distortion_vert.spv.hLinux
./bin/glslangValidator -V --vn distortion_frag
$SHADERS_FOLDER_PATH /distortion.frag -o distortion_frag.spv.h./bin/glslangValidator -V --vn distortion_vert
$SHADERS_FOLDER_PATH /distortion.vert -o distortion_vert.spv.h
You should now have distortion_frag.spv.h and distortion_vert.spv.h.