Package icyllis.arc3d.engine
Class ShaderVar
java.lang.Object
icyllis.arc3d.engine.ShaderVar
Represents a variable in a shader.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
TypeModifiersstatic final byte
TypeModifiersstatic final int
Values for array length that have special meaning.static final byte
TypeModifiersstatic final byte
TypeModifiersstatic final byte
TypeModifiers -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Get the array length.getName()
Get the name.byte
getType()
Get the type.byte
boolean
isArray()
Is the var an array.void
Sets as a non-array.void
setTypeModifier
(byte typeModifier)
-
Field Details
-
kNone_TypeModifier
public static final byte kNone_TypeModifierTypeModifiers- See Also:
-
kOut_TypeModifier
public static final byte kOut_TypeModifierTypeModifiers- See Also:
-
kIn_TypeModifier
public static final byte kIn_TypeModifierTypeModifiers- See Also:
-
kInOut_TypeModifier
public static final byte kInOut_TypeModifierTypeModifiers- See Also:
-
kUniform_TypeModifier
public static final byte kUniform_TypeModifierTypeModifiers- See Also:
-
kNonArray
public static final int kNonArrayValues 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
-
ShaderVar
-
ShaderVar
-
ShaderVar
-
ShaderVar
-
-
Method Details
-
set
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 bekNonArray
. -
getName
Get the name. -
getType
public byte getType()Get the type.- See Also:
-
getTypeModifier
public byte getTypeModifier() -
setTypeModifier
public void setTypeModifier(byte typeModifier) -
addLayoutQualifier
Appends to the layout qualifier. -
addLayoutQualifier
Appends to the layout qualifier. -
addModifier
Appends to the modifiers. -
appendDecl
Write a declaration of this variable to out.
-