Package icyllis.arc3d.compiler

# Class CompileOptions

java.lang.Object
icyllis.arc3d.compiler.CompileOptions

public class CompileOptions extends Object
Holds the options for compiling a shader executable. This is ignored when pre-parsing a module unit (include file).

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `String`
  `mEntryPointName`
  Function with this name will be considered as the entry point of a shader executable.
  `Map<String,String>`
  `mExtensions`
  A pre-defined extensions, before preprocessing.
  `boolean`
  `mForceHighPrecision`
  No relax precision when generating SPIR-V.
  `boolean`
  `mMinifyCode`
  Try to minify code when generating GLSL.
  `boolean`
  `mMinifyNames`
  Try to minify symbol names (variables, functions, structure members).
  `boolean`
  `mNoShortCircuit`
  Force no short-circuit operators when generating code.
  `int`
  `mOptimizationLevel`
  Optimization level.
  `boolean`
  `mPreprocess`
  Whether to do preprocessing? If you have done preprocessing, you may set this to false.
  `boolean`
  `mUsePrecisionQualifiers`
  Allow precision qualifiers (mediump, highp) when generating GLSL.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CompileOptions()`

- ## Method Summary

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### mPreprocess

    public boolean mPreprocess
    Whether 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:
      - `Parser.preprocess()`

  - ### mExtensions

    public Map<String,String> 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

    public String mEntryPointName
    Function with this name will be considered as the entry point of a shader executable.

  - ### mForceHighPrecision

    public boolean mForceHighPrecision
    No relax precision when generating SPIR-V. No mediump precision when generating GLSL.

  - ### mUsePrecisionQualifiers

    public boolean mUsePrecisionQualifiers
    Allow precision qualifiers (mediump, highp) when generating GLSL. This can be used for GLSL Vulkan and GLSL ES.

  - ### mNoShortCircuit

    public boolean mNoShortCircuit
    Force 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 mMinifyNames
    Try 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 mMinifyCode
    Try 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 mOptimizationLevel
    Optimization level. (0-2)

    Even if this is 0, the compiler can still do some optimizations.

- ## Constructor Details

  - ### CompileOptions

    public CompileOptions()