google / shaderc

A collection of tools, libraries, and tests for Vulkan shader compilation.
Other
1.86k stars 363 forks source link

Support for skipping preprocessing #1425

Open anstdelisle opened 5 months ago

anstdelisle commented 5 months ago

It would be nice to have the option of skipping the preprocessor. As an example, gcc does it with the -fpreprocessed: https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-fpreprocessed

This is useful for cases when the preprocessed file is held on for later and enables skipping the redundant preprocessor step when using a pattern like:

glslc -E -o FOO.i.frag FOO.frag
glslc -c -o FOO.spv FOO.i.frag