Compilation options.
To be created using a structure init:
var options:CompilationOptions = {
autoBindUniforms: false,
// ...
};
Variables
optionalautoBindUniforms:Null<Bool>
Optional, sets whether the compiler should automatically assign bindings to uniforms that aren't already explicitly bound in the shader source.
Defaults to false
.
optionalautoMapLocations:Null<Bool>
Optional, sets whether the compiler should automatically assign locations to uniform variables that don't have explicit locations in the shader source.
Defaults to false
.
optionalbindingBases:Null<Map<UniformKind, Int>>
Optional, sets the base binding number used for for a uniform resource type when automatically assigning bindings. For GLSL compilation, sets the lowest automatically assigned number. For HLSL compilation, the regsiter number assigned to the resource is added to this specified base.
optionalbindingBasesForStage:Null<Map<Kind, Map<UniformKind, Int>>>
Optional, like Options.bindingBases
, but only takes effect when compiling a given shader stage. The stage is assumed to be one of Kind.Vertex
, Kind.Fragment
, Kind.TessellationEvaluation
, Kind.TesselationControl
, Kind.Geometry
, or Kind.Compute
.
optionalforcedVersionProfile:Null<{version:Int, profile:Profile}>
Optional, forces the GLSL language version and profile to a given pair.
The version number is the same as would appear in the #version annotation in the source.
Version and profile specified here overrides the #version annotation in the source. Use profile: Profile.None
for GLSL versions that do not define profiles, e.g. versions below 150.
Default version is 110.
optionalgenerateDebugInfo:Null<Bool>
Optional, sets the compiler mode to generate debug information in the output.
Defaults to false
.
optionalhlsl:Null<HlslOptions>
HLSL specific options.
These are ignored if the source language is GLSL.
optionalhlslOffsets:Null<Bool>
Whether the compiler should determine block member offsets using HLSL packing rules instead of standard GLSL rules.
Defaults to false
.
Only affects GLSL compilation, HLSL rules are always used when compiling HLSL.
optionalinvertY:Null<Bool>
Optional, sets whether the compiler should invert position.Y output in vertex shader.
Defaults to false
.
optionalmacroDefinitions:Null<Map<String, Null<String>>>
Optional, adds predefined macros.
If the value is null
, it has the same effect as passing -Dname to the command-line compiler.
optionalnanClamp:Null<Bool>
Optional, sets whether the compiler generates code for max and min builtins which, if given a NaN operand, will return the other operand.
Similarly, the clamp builtin will favour the non-NaN operands, as if clamp were implemented as a composition of max and min.
Defaults to false
.
optionaloptimizationLevel:Null<OptimizationLevel>
Optional, sets the compiler optimization level to the given level.
Defaults to OptimizationLevel.None
.
optionalsourceLanguage:Null<SourceLanguage>
Optinal, sets the source language.
Defaults to SourceLanguage.Glsl
.
optionalsuppressWarnings:Null<Bool>
Optional, sets the compiler mode to suppress warnings, overriding Options.warningsAsError
mode.
When both Options.supressWarnings
and Options.warningsAsError
are true
, warning messages will be inhibited, and will not be emitted as error messages.
Defaults to false
.
optionaltargetEnvironment:Null<TargetEnvironment>
Optional, sets the target shader environment, affecting which warnings or errors will be issued.
Defaults to TargetEnvironment.Vulkan
.
optionaltargetSpirvVersion:Null<SpirvVersion>
Optional, sets the target SPIR-V version.
The generated module will use this version of SPIR-V. Each target environment determines what versions of SPIR-V it can consume.
Defaults to the highest version of SPIR-V 1.0 which is required to be supported by the target environment, e.g. default to SPIR-V 1.0 for Vulkan 1.0 and SPIR-V 1.3 for Vulkan 1.1.
optionalwarningsAsErrors:Null<Bool>
Optional, sets the compiler mode to treat all warnings as errors.
Note Options.supressWarnings
overrides this option, i.e. if both Options.warningsAsError
and Options.supressWarnings
are true
, warnings will not be emitted as error messages.