How to use glslang

我是研究僧i 提交于 2019-12-06 05:15:34
johnkslang

There are several libs you need to use. An example consumer to look at is LunarGLASS: https://github.com/LunarG/LunarGLASS. There, you can see the file:

https://github.com/LunarG/LunarGLASS/blob/master/CMakeLists.txt

Which inside contains this for the libraries:

set(GLSLANGLIBS
    glslang
    HLSL
    OSDependent
    OGLCompiler
    SPIRV)

The readme for glslang contains some important information. In addition, within glslang, the glslangValidator tool (basically StandAlone.cpp) shows how to use the API for the libraries. You can also see the Frontends/glslang directory in the LunarGLASS project for a similar use.

The Shaderc project at https://github.com/google/shaderc provides an easy-to-use C++ API that wraps around Glslang's compiler to SPIR-V.

For example usage, see https://github.com/google/shaderc/blob/master/examples/online-compile/main.cc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!