#Compiling WGSL with #import directives and outputting SPIR-V file

3 messages · Page 1 of 1 (latest)

dull narwhal
#

Is there a way to use bevy's shader compilation to convert WGSL to SPIR-V and output the SPIR-V shader as a file? I tried using naga CLI tools but unlike bevy it doesn't seem to understand how to handle #import declarations.

rigid dawn
#

Bevy uses naga_oil to do things like imports, it's not part of naga itself

#

You could probably write a small program to load a shader with naga + naga oil, compile to spirv, and then output it