Class CompileOptions
-
Field Summary
Modifier and TypeFieldDescriptionFunction with this name will be considered as the entry point of a shader executable.A pre-defined extensions, before preprocessing.boolean
No relax precision when generating SPIR-V.boolean
Try to minify code when generating GLSL.boolean
Try to minify symbol names (variables, functions, structure members).boolean
Force no short-circuit operators when generating code.int
Optimization level.boolean
Whether to do preprocessing? If you have done preprocessing, you may set this to false.boolean
Allow precision qualifiers (mediump, highp) when generating GLSL. -
Constructor Summary
-
Method Summary
-
Field Details
-
mPreprocess
public boolean mPreprocessWhether to do preprocessing? If you have done preprocessing, you may set this to false.Note: Our preprocessor is not available for module units.
- See Also:
-
mExtensions
A pre-defined extensions, before preprocessing. This is a list of (extensionName, behavior) pairs, no error checking will be performed.The extension has no semantics impact when generating SPIR-V, but it's retained when generating GLSL for some GLSL only extensions. A new behavior will override the earlier one for the same extension name.
-
mEntryPointName
Function with this name will be considered as the entry point of a shader executable. -
mForceHighPrecision
public boolean mForceHighPrecisionNo relax precision when generating SPIR-V. No mediump precision when generating GLSL. -
mUsePrecisionQualifiers
public boolean mUsePrecisionQualifiersAllow precision qualifiers (mediump, highp) when generating GLSL. This can be used for GLSL Vulkan and GLSL ES. -
mNoShortCircuit
public boolean mNoShortCircuitForce no short-circuit operators when generating code.For 'invalid input: '&'invalid input: '&'', '||' and '?:', always evaluate both sides. No branching is usually more performant.
Use with caution, may have side effects.
-
mMinifyNames
public boolean mMinifyNamesTry to minify symbol names (variables, functions, structure members).At AST level, all private symbols will be renamed and minified.
For GLSL, minify names that have no semantic impact. This depends on the target GLSL version. For example, interface blocks with binding and vertex attributes with location will have their names minified.
For SPIR-V, the generator will not emit any OpName or OpMemberName instructions, so that all names are removed.
If this is false, the generator will output mangled function names, except for the entry point.
-
mMinifyCode
public boolean mMinifyCodeTry to minify code when generating GLSL. Whitespaces and unnecessary characters will be removed. Otherwise, the generated code may be pretty printed with indentation.This option may be useful when generating SPIR-V. This option does not mean eliminating unused variables and functions, see
mOptimizationLevel
. -
mOptimizationLevel
public int mOptimizationLevelOptimization level. (0-2)Even if this is 0, the compiler can still do some optimizations.
-
-
Constructor Details
-
CompileOptions
public CompileOptions()
-