0

I'm looking to take my GLSL shader files which have the extension .vert and .frag and have them compile to SPIR-V format after the project build. Currently I have been using a .bat file which compiles all my GLSL files to SPIR-V however, hitting the .bat file every time I make a change to a shader is far from ideal so I have been exploring other methods such as VS2019 Build step. I have read through the docs on MSDN but I am still finding myself confused on how to correctly utilise this feature so I can compile all my GLSL files to SPIR-V.

What I have tried:

Properties -> Custom Build Step -> General

Command Line:

glslangValidator.exe -V %(SolutionDir)%(Shaders)%(Filename).vert-o "%(SolutionDir)%(Shaders)%(Filename).spv

Ouputs:

%(SolutionDir)%(Shaders)%(Filename).spv

The error I receive is MSB3073: The command "glslangValidator.exe -V App.vert-o App.spv :VCEnd" exited with code 1. App.

Where App is the name of the project and not a GLSL file. I have also tried specifying the name of a single GLSL file (replacing Filename) but this resulted in the same error except App was no longer present glslangValidator.exe -V .vert-o .spv :VCEnd

Would appreciate any insight into how I might go about compiling my GLSL files to SPIR-V using glslangValidator through the Custom Build Step.

Krellex
  • 613
  • 2
  • 7
  • 20

0 Answers0