Jonathan Woollett-light
Jonathan Woollett-light

Reputation: 3243

How could I simply compile GLSL to SPIR-V?

So I need to get the SPIR-V code of some GLSL

Every resource I can find on the topic involves setting up a whole enviroment for graphics and more.

In the simplest case when I have some GLSL code and I want to get the SPIR-V code, what would be the best way?

Upvotes: 5

Views: 11593

Answers (1)

Makogan
Makogan

Reputation: 9540

The Khronos group provide the Vulkan SDK, which is free to download. In that there is a command line tool glslc which you can call from the command line as so:

VulkanSDK/x.x.x.x/Bin/glslc shader.vert -o vert.spv

An example on how to use it also available in the vulkan tutorial. It's pretty plug and play, just download the SDK and run from a terminal.

Upvotes: 8

Related Questions