Package icyllis.arc3d.engine

# Class ShaderVar

java.lang.Object
icyllis.arc3d.engine.ShaderVar

public class ShaderVar extends Object
Represents a variable in a shader.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final byte`
  `kIn_TypeModifier`
  TypeModifiers
  `static final byte`
  `kInOut_TypeModifier`
  TypeModifiers
  `static final int`
  `kNonArray`
  Values for array length that have special meaning.
  `static final byte`
  `kNone_TypeModifier`
  TypeModifiers
  `static final byte`
  `kOut_TypeModifier`
  TypeModifiers
  `static final byte`
  `kUniform_TypeModifier`
  TypeModifiers

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ShaderVar()`
  Defaults to a void with no type modifier or layout qualifier.
  `ShaderVar(String name, byte type)`
  `ShaderVar(String name, byte type, byte typeModifier)`
  `ShaderVar(String name, byte type, byte typeModifier, int arraySize)`
  `ShaderVar(String name, byte type, byte typeModifier, int arraySize, String layoutQualifier, String extraModifier)`
  `ShaderVar(String name, byte type, int arraySize)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addLayoutQualifier(String layoutQualifier)`
  Appends to the layout qualifier.
  `void`
  `addLayoutQualifier(String qualifier, int value)`
  Appends to the layout qualifier.
  `void`
  `addModifier(String modifier)`
  Appends to the modifiers.
  `void`
  `appendDecl(StringBuilder out)`
  Write a declaration of this variable to out.
  `int`
  `getArraySize()`
  Get the array length.
  `String`
  `getName()`
  Get the name.
  `byte`
  `getType()`
  Get the type.
  `byte`
  `getTypeModifier()`
  `boolean`
  `isArray()`
  Is the var an array.
  `void`
  `set(String name, byte type)`
  Sets as a non-array.
  `void`
  `setTypeModifier(byte typeModifier)`

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

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

- ## Field Details

  - ### kNone_TypeModifier

    public static final byte kNone_TypeModifier
    TypeModifiers
    See Also:
      - Constant Field Values

  - ### kOut_TypeModifier

    public static final byte kOut_TypeModifier
    TypeModifiers
    See Also:
      - Constant Field Values

  - ### kIn_TypeModifier

    public static final byte kIn_TypeModifier
    TypeModifiers
    See Also:
      - Constant Field Values

  - ### kInOut_TypeModifier

    public static final byte kInOut_TypeModifier
    TypeModifiers
    See Also:
      - Constant Field Values

  - ### kUniform_TypeModifier

    public static final byte kUniform_TypeModifier
    TypeModifiers
    See Also:
      - Constant Field Values

  - ### kNonArray

    public static final int kNonArray
    Values for array length that have special meaning. We allow 1-sized arrays.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ShaderVar

    public ShaderVar()
    Defaults to a void with no type modifier or layout qualifier.

  - ### ShaderVar

    public ShaderVar(String name, byte type)

  - ### ShaderVar

    public ShaderVar(String name, byte type, int arraySize)

  - ### ShaderVar

    public ShaderVar(String name, byte type, byte typeModifier)

  - ### ShaderVar

    public ShaderVar(String name, byte type, byte typeModifier, int arraySize)

  - ### ShaderVar

    public ShaderVar(String name, byte type, byte typeModifier, int arraySize, String layoutQualifier, String extraModifier)

- ## Method Details

  - ### set

    public void set(String name, byte type)
    Sets as a non-array. Internally used with the default constructor.

  - ### isArray

    public boolean isArray()
    Is the var an array.

  - ### getArraySize

    public int getArraySize()
    Get the array length. May be `kNonArray`.

  - ### getName

    public String getName()
    Get the name.

  - ### getType

    public byte getType()
    Get the type.
    See Also:
      - `SLDataType`

  - ### getTypeModifier

    public byte getTypeModifier()

  - ### setTypeModifier

    public void setTypeModifier(byte typeModifier)

  - ### addLayoutQualifier

    public void addLayoutQualifier(String layoutQualifier)
    Appends to the layout qualifier.

  - ### addLayoutQualifier

    public void addLayoutQualifier(String qualifier, int value)
    Appends to the layout qualifier.

  - ### addModifier

    public void addModifier(String modifier)
    Appends to the modifiers.

  - ### appendDecl

    public void appendDecl(StringBuilder out)
    Write a declaration of this variable to out.