- Components:
(1)一个用GLSL前端用于参考验证和将GLSL转换成AST
(2)一个SPIR-V后端将AST转换为SPIR-V
(3)一个独立的包glslangValidator作为以上部分的命令行工具
重要的是ShaderLang.h and StandAlone.cpp
GLSlang是高级版的着色器语言。
Below is a new alternate C++ interface, which deprecates the above opaque handle-based interface.
The below is further designed to handle multiple compilation units per stage, where the intermediate results, including the parse tree, are preserved until link time,rather than the above interface which is designed to have each compilation unit lowered at compile time. In the above model, linking occurs on the lowered results, whereas in this model intra-stage linking can occur at the parse tree(treeRoot in TIntermediate) level, and then a full stage can be lowered.
设计处理中间结果(包括分析树)的每一阶段的多个编译单元,被保存到链接时间,而上面的接口设计为在编译时降低每个编译单元的编译时间。在上面的模型中,链接发生在降低的结果上,然而下面的模型,内部阶段的链接发生在解析树等级,从而降低全部阶段的时间。