Relies on glslang to compile GLSL shaders to SPIR-V and generate reflection data.
More...
#include <ShaderCompiler.hpp>
Relies on glslang to compile GLSL shaders to SPIR-V and 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 |
◆ convertType()
Convert a uniform compiler type to Rendu internal types.
- Parameters
-
- Returns
- the corresponding Rendu uniform type
◆ getSetFromType()
uint ShaderCompiler::getSetFromType |
( |
const glslang::TType & |
type | ) |
|
|
staticprivate |
Retrieve a set location from its type.
- Parameters
-
- Returns
- the set location
◆ init()
bool ShaderCompiler::init |
( |
| ) |
|
|
static |
Initialize the compiler library.
- Returns
- the success status
◆ reflect()
void ShaderCompiler::reflect |
( |
glslang::TProgram & |
program, |
|
|
Program::Stage & |
stage |
|
) |
| |
|
staticprivate |
Perform reflection on a compiled program and populate our reflection structures.
- Parameters
-
program | the compiled SPIR-V program |
stage | will contain reflection data |
The documentation for this class was generated from the following files: