ShaderFeature
enum ShaderFeature
Package: dev.joid.lib.bridge.render.shader.source · Module: core · Source: ShaderFeature.java
A GLSL feature that only some dialects accept, with the first desktop and ES versions that have it and the pattern that finds it in a source.
Description
Section titled “Description”ShaderSource finds the features of each stage.
GlslShaderTranslator refuses a stage that uses a feature its GlslDialect lacks, and in dev mode the constructor of Shader warns once about each feature beyond GLSL 1.20, since such a shader does not compile on every backend.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
Set<ShaderFeature> | find(CharSequence code) static | Returns the features that a piece of GLSL code uses. |
String | getDescription() | Returns the name of the feature in messages, such as flat varyings. |
GlslDialect | getGlsl() | Returns the first desktop GLSL version that accepts the feature. |
GlslDialect | getEssl() | Returns the first GLSL ES version that accepts the feature. |
Pattern | getPattern() | Returns the regular expression that finds the feature in GLSL code. |
Values
Section titled “Values”| Value | Summary |
|---|---|
FLAT_VARYINGS | The flat qualifier, which turns off the interpolation of a varying. |
UNSIGNED_INTEGERS | The uint and uvec types. |
BITWISE_OPERATORS | The <<, >>, &, |, ^, ~ and % operators. |
SWITCH | The switch statement. |
TEXEL_FETCH | The texelFetch and texelFetchOffset functions, which read a texel at integer coordinates. |
TEXTURE_SIZE | The textureSize function. |
DERIVATIVES | The dFdx, dFdy and fwidth functions: in every desktop dialect, and from ESSL 3.00 in GLSL ES. |
Method details
Section titled “Method details”Set<ShaderFeature> find(CharSequence code) static
Returns the features that a piece of GLSL code uses. The code is searched as it is: strip the comments first, or a word in a comment counts.
getDescription
Section titled “getDescription”String getDescription()
Returns the name of the feature in messages, such as flat varyings.
getGlsl
Section titled “getGlsl”GlslDialect getGlsl()
Returns the first desktop GLSL version that accepts the feature.
getEssl
Section titled “getEssl”GlslDialect getEssl()
Returns the first GLSL ES version that accepts the feature.
getPattern
Section titled “getPattern”Pattern getPattern()
Returns the regular expression that finds the feature in GLSL code.
Value details
Section titled “Value details”FLAT_VARYINGS
Section titled “FLAT_VARYINGS”FLAT_VARYINGS
The flat qualifier, which turns off the interpolation of a varying.
UNSIGNED_INTEGERS
Section titled “UNSIGNED_INTEGERS”UNSIGNED_INTEGERS
The uint and uvec types.
BITWISE_OPERATORS
Section titled “BITWISE_OPERATORS”BITWISE_OPERATORS
The <<, >>, &, |, ^, ~ and % operators.
SWITCH
Section titled “SWITCH”SWITCH
The switch statement.
TEXEL_FETCH
Section titled “TEXEL_FETCH”TEXEL_FETCH
The texelFetch and texelFetchOffset functions, which read a texel at integer coordinates.
TEXTURE_SIZE
Section titled “TEXTURE_SIZE”TEXTURE_SIZE
The textureSize function.
DERIVATIVES
Section titled “DERIVATIVES”DERIVATIVES
The dFdx, dFdy and fwidth functions: in every desktop dialect, and from ESSL 3.00 in GLSL ES.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
