Relies on glslang to compile GLSL shaders to SPIR-V and SPIRV-Cross to generate reflection data.
More...
#include <ShaderCompiler.hpp>
Relies on glslang to compile GLSL shaders to SPIR-V and SPIRV-Cross to generate reflection data.
◆ clean()
Destroy a compiled shader
- Parameters
-
| stage | the shader to cleanup |
◆ cleanup()
| void ShaderCompiler::cleanup |
( |
| ) |
|
|
static |
Close the compiler library.
◆ compile()
| void ShaderCompiler::compile |
( |
const std::string & |
prog, |
|
|
ShaderType |
type, |
|
|
Program::Stage & |
stage, |
|
|
bool |
generateModule, |
|
|
std::string & |
finalLog |
|
) |
| |
|
static |
Create a shader of a given type from a string. Extract additional informations from the shader.
- Parameters
-
| prog | the content of the shader |
| type | the type of shader (vertex, fragment,...) |
| stage | will be filled with reflection information: the samplers/buffers present in the shader and their user-defined locations, along with the compiled results |
| generateModule | shoud a Vulkan module be generated from the SPIR-V code |
| finalLog | will contain the compilation log of the shader |
◆ init()
| bool ShaderCompiler::init |
( |
| ) |
|
|
static |
Initialize the compiler library.
- Returns
- the success status
◆ reflect()
| void ShaderCompiler::reflect |
( |
const std::vector< uint32_t > & |
spirv, |
|
|
Program::Stage & |
stage |
|
) |
| |
|
staticprivate |
Perform reflection on a compiled program and populate our reflection structures.
- Parameters
-
| spirv | the compiled SPIR-V program |
| stage | will contain reflection data |
The documentation for this class was generated from the following files: