# Generate Vulkan header files for each shader

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

1. Download the [Khronos Group Glslang Tool: Candidate of July 26, 2020](https://github.com/KhronosGroup/glslang/releases/tag/SDK-candidate-26-Jul-2020) on your local machine.

2. Unzip it.

3. Check its version:

   - Windows

     ```
     bin\glslangValidator --version
     ```

     <br />

   - macOS

     ```
     ./bin/glslangValidator --version
     ```

     <br />

   - Linux

     ```
     ./bin/glslangValidator --version
     ```

     <br />

4. In the Cardboard repository, locate the `sdk/rendering/android/shaders` folder and save its path.

5. Generate the Vulkan header files in C++:

   - Windows

         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

     <br />

   - macOS

         ./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

     <br />

   - Linux

         ./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

     <br />

You should now have **distortion_frag.spv.h** and **distortion_vert.spv.h**.