Class ShaderVar

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

public class ShaderVar extends Object
Represents a variable in a shader.
  • Field Details

    • kNone_TypeModifier

      public static final byte kNone_TypeModifier
      TypeModifiers
      See Also:
    • kOut_TypeModifier

      public static final byte kOut_TypeModifier
      TypeModifiers
      See Also:
    • kIn_TypeModifier

      public static final byte kIn_TypeModifier
      TypeModifiers
      See Also:
    • kInOut_TypeModifier

      public static final byte kInOut_TypeModifier
      TypeModifiers
      See Also:
    • kUniform_TypeModifier

      public static final byte kUniform_TypeModifier
      TypeModifiers
      See Also:
    • kNonArray

      public static final int kNonArray
      Values for array length that have special meaning. We allow 1-sized arrays.
      See Also:
  • 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:
    • 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.