class Nya::Render::Backends::GL::GLSLCompiler
- Nya::Render::Backends::GL::GLSLCompiler
- Reference
- Object
Overview
GLSL shader compiler
Defined in:
nya/render/backends/gl/glsl_compiler.crConstant Summary
-
REQUIRE_REGEX =
/^\s*\/\/\s*@require (?<name>.+)/
Class Method Summary
-
.compile(filename : String, stype : ShaderType | Nil = nil)
Compiles shader If
stype
is not set, it is detected automatically using.detect_type
-
.detect_type(text, filename : String | Nil = nil)
Detects shader type using
//@type shader_type
directive and file extensionfrag*
- fragment shadertess*c*
- tesselation control shadertess*e*
- tesselation evaluation shadergeom*
- geometry shader Shader with other type is considered vertex shader -
.flush_cache!
Flushes preprocessor, compiler and linker cache
-
.link(shaders : Array(UInt32))
Links a shader program
-
.preprocess(text : String)
Preprocesses shader In fact, that only replaces
@require file
with the contents of thefile
Class Method Detail
Compiles shader
If stype
is not set, it is detected automatically using .detect_type
Detects shader type using //@type shader_type
directive and file extension
frag*
- fragment shader
tess*c*
- tesselation control shader
tess*e*
- tesselation evaluation shader
geom*
- geometry shader
Shader with other type is considered vertex shader
Preprocesses shader
In fact, that only replaces @require file
with the contents of the file