Shader language custom features
A Shader Language preprocessor processes the shader code to add some custom features.
~'#include'~'#import' statement
Include statement to include the code of another shader file into the code of current shader file. For example:
#import "library/another.shader"
Collecting shader information
Collecting the shader source code information into the data structure. Including but not limited to uniforms, vertex attributes, ins, outs, consts, functions.
#include can only be supported if the graphics card has this extension supported: GL_ARB_shading_language_include
If we have to support this on any cards, we do need some tricks to simulate it
#includecan only be supported if the graphics card has this extension supported: GL_ARB_shading_language_include
No, I want to preprocess this statement before compiling shader code.
decided to refer https://github.com/KhronosGroup/glslang for 'collecting shader information' to help us build the parser