Can I see shader preprocessor output?

I am using #defines, which I pass runtime to my shader sources based on program state, to optimize my huge shaders to be less complex. I would like to write the optimized shader to a file so that next time I run my program, I do not have to pass the #defines again, but I can straight compile the optimized shaders during program startup because now I know what kind of shaders by program needs.

Is there a way to get the result from shader preprocessor? I can of course store the #define values to a file and based on that compile the shaders during program startup but that would not be as elegant.


Preprocess the shader source using a C preprocessor.

For example, GCC have an option for preprocess only the source, and save the intermediate result in another file, using the option for defining preprocessor symbols, you will get the wanted result.

Need Your Help

What are standards for characters allowed in text fields

html textbox standards passwords character

What are the typical characters allowed in text fields in a new user sign-up? Are there www standards? Especially interested in Username and Password character types allowed.

What is the difference between the mouseover and mouseenter events?

javascript jquery events javascript-events

I have always used the mouseover event, but while reading the jQuery documentation I found mouseenter. They seem to function exactly the same.