SPIR-V Extension for Visual Studio


About

With the launch of Vulkan, SPIR-V has been introduced as it’s binary shader format, replacing text based shader formats in favor of an intermediate representation. To make life a bit easier I have just released a Visual Studio (2015) extension that adds SPIR-V related commands to the context menu of shader files (and folders containing shader files):

vs2015

contextmenufolder

This allows you got generate binary SPIR-V files from GLSL right out of your IDE. The commands use the glslang reference compiler for this and work on all file extensions supported by it.

The extension also parses errors generated if the shader does not compile and adds them to the error list of Visual Studio, so you can double click to jump to the file and line that the error occurred:

errorlist

The extension supports Vulkan and OpenGL semantics for generating the SPIR-V binary files, so if you happen to have a GPU and driver that supports SPIR-V for OpenGL you can generate binary shaders for OpenGL too. To get you started with SPIR-V for OpenGL I have released a simple C++ example that shows how to use SPIR-V with OpenGL.

As for Vulkan, SPIR-V is the only official (i.e. non-extension) source for loading shaders and is used in all of my C++ open source Vulkan examples.

Download

Source (C#) and download (VSIX for VS2015) can be found at https://github.com/SaschaWillems/SPIRV-VSExtension