Skip to content

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.

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.

ReturnsSignatureSummary
Set<ShaderFeature>find(CharSequence code) staticReturns the features that a piece of GLSL code uses.
StringgetDescription()Returns the name of the feature in messages, such as flat varyings.
GlslDialectgetGlsl()Returns the first desktop GLSL version that accepts the feature.
GlslDialectgetEssl()Returns the first GLSL ES version that accepts the feature.
PatterngetPattern()Returns the regular expression that finds the feature in GLSL code.
ValueSummary
FLAT_VARYINGSThe flat qualifier, which turns off the interpolation of a varying.
UNSIGNED_INTEGERSThe uint and uvec types.
BITWISE_OPERATORSThe <<, >>, &, |, ^, ~ and % operators.
SWITCHThe switch statement.
TEXEL_FETCHThe texelFetch and texelFetchOffset functions, which read a texel at integer coordinates.
TEXTURE_SIZEThe textureSize function.
DERIVATIVESThe dFdx, dFdy and fwidth functions: in every desktop dialect, and from ESSL 3.00 in GLSL ES.

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.

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.

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.


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

Report a problem with this page