Package icyllis.arc3d.compiler.tree
Class Type.AliasType
java.lang.Object
icyllis.arc3d.compiler.tree.Node
icyllis.arc3d.compiler.tree.Symbol
icyllis.arc3d.compiler.tree.Type
icyllis.arc3d.compiler.tree.Type.AliasType
- Enclosing class:
Type
-
Nested Class Summary
Nested classes/interfaces inherited from class icyllis.arc3d.compiler.tree.Type
Type.AliasType, Type.ArrayType, Type.CoercionCost, Type.Field, Type.GenericType, Type.ImageType, Type.MatrixType, Type.SamplerType, Type.ScalarType, Type.StructType, Type.VectorTypeNested classes/interfaces inherited from class icyllis.arc3d.compiler.tree.Node
Node.ElementKind, Node.ExpressionKind, Node.StatementKind, Node.SymbolKind -
Field Summary
Fields inherited from class icyllis.arc3d.compiler.tree.Type
kArray_TypeKind, kBoolean_ScalarKind, kFloat_ScalarKind, kGeneric_TypeKind, kMatrix_TypeKind, kMaxNestingDepth, kNonScalar_ScalarKind, kOther_TypeKind, kSampler_TypeKind, kScalar_TypeKind, kSigned_ScalarKind, kStruct_TypeKind, kUnsigned_ScalarKind, kUnsizedArray, kVector_TypeKind, kVoid_TypeKind -
Method Summary
Modifier and TypeMethodDescriptionintFor arrays, returns either the size of the array (if known) or -1 (unsized).For generic types, returns the types that this generic type can substitute for.intgetCols()For matrices, returns the number of columns (e.g.intFor type that contains scalars, returns the number of scalars.@NonNull TypeFor matrices and vectors, returns the scalar type of individual cells (e.g.intFor sampler/image types, returns the SpvDim.@NonNull TypeFor arrays, returns the base type.@Unmodifiable List<Type.Field> doubleReturns the maximum value that can fit in the type.doubleReturns the minimum value that can fit in the type.intFor scalars, returns the minimum size in bits of the type.intgetRank()Returns the "rank" of a numeric type, in order of float > half > int > short.intgetRows()For matrices and vectors, returns the number of rows (e.g.byteReturns the ScalarKind of this type (always NonScalar for non-scalar values).intgetWidth()For scalars, returns the size in bits of the type.booleanisArray()booleanTrue for arrayed texture.booleanbooleanbooleanisMatrix()booleanbooleanbooleanisScalar()booleanbooleanisShadow()True for samplers that sample a depth texture with comparison (e.g., samplerShadow, sampler2DShadow, HLSL SamplerComparisonState).booleanbooleanisStruct()booleanbooleanisVector()@NonNull Typeresolve()If this is an alias, returns the underlying type, otherwise returns this.Methods inherited from class icyllis.arc3d.compiler.tree.Type
canCoerceTo, checkLiteralOutOfRange, coerceExpression, convertArraySize, convertArraySize, getArrayName, getArrayName, getCoercionCost, getDesc, getKind, getNestingDepth, getType, getTypeKind, isBoolean, isBooleanOrCompound, isFloat, isFloatOrCompound, isGeneric, isInBuiltinTypes, isInteger, isNumeric, isOpaque, isRelaxedPrecision, isSigned, isSignedOrCompound, isUnsigned, isUnsignedOrCompound, isUsableInArray, isVoid, makeAliasType, makeAliasType, makeArrayType, makeCombinedType, makeGenericType, makeImageType, makeMatrixType, makeSamplerType, makeScalarType, makeScalarType, makeSeparateType, makeSpecialType, makeStructType, makeTextureType, makeVectorType, matches, toCompound, toString, toVectorMethods inherited from class icyllis.arc3d.compiler.tree.Node
getEndOffset, getStartOffset
-
Method Details
-
resolve
Description copied from class:TypeIf this is an alias, returns the underlying type, otherwise returns this. -
getElementType
Description copied from class:TypeFor arrays, returns the base type. For matrices, returns the column vector type. For vectors, returns the scalar type. For all other types, returns the type itself.- Overrides:
getElementTypein classType
-
getComponentType
Description copied from class:TypeFor matrices and vectors, returns the scalar type of individual cells (e.g. mat2 has a component type of Float). For textures, returns the sampled type (e.g. texture2D has a component type of Float). For arrays, returns the component type of their base type. For all other types, returns the type itself.- Overrides:
getComponentTypein classType
-
getScalarKind
public byte getScalarKind()Description copied from class:TypeReturns the ScalarKind of this type (always NonScalar for non-scalar values).- Overrides:
getScalarKindin classType
-
getRank
public int getRank()Description copied from class:TypeReturns the "rank" of a numeric type, in order of float > half > int > short. When operating on two numeric types, the result is the higher-rank type. -
getCols
public int getCols()Description copied from class:TypeFor matrices, returns the number of columns (e.g. mat3x4 returns 3). For scalars and vectors, returns 1. For all other types, causes an assertion failure. -
getRows
public int getRows()Description copied from class:TypeFor matrices and vectors, returns the number of rows (e.g. mat3x4 return 4). For scalars, returns 1. For all other types, causes an assertion failure. -
getComponents
public int getComponents()Description copied from class:TypeFor type that contains scalars, returns the number of scalars. For all other types, causes an assertion failure.- Overrides:
getComponentsin classType
-
getArraySize
public int getArraySize()Description copied from class:TypeFor arrays, returns either the size of the array (if known) or -1 (unsized). For all other types, causes an assertion failure.- Overrides:
getArraySizein classType
-
getMinValue
public double getMinValue()Description copied from class:TypeReturns the minimum value that can fit in the type.- Overrides:
getMinValuein classType
-
getMaxValue
public double getMaxValue()Description copied from class:TypeReturns the maximum value that can fit in the type.- Overrides:
getMaxValuein classType
-
getMinWidth
public int getMinWidth()Description copied from class:TypeFor scalars, returns the minimum size in bits of the type.- Overrides:
getMinWidthin classType
-
getWidth
public int getWidth()Description copied from class:TypeFor scalars, returns the size in bits of the type. -
getDimensions
public int getDimensions()Description copied from class:TypeFor sampler/image types, returns the SpvDim. For all other types, causes an assertion failure.- Overrides:
getDimensionsin classType
-
isShadow
public boolean isShadow()Description copied from class:TypeTrue for samplers that sample a depth texture with comparison (e.g., samplerShadow, sampler2DShadow, HLSL SamplerComparisonState). -
isArrayed
public boolean isArrayed()Description copied from class:TypeTrue for arrayed texture. -
isScalar
public boolean isScalar() -
isVector
public boolean isVector() -
isMatrix
public boolean isMatrix() -
isArray
public boolean isArray() -
isUnsizedArray
public boolean isUnsizedArray()- Overrides:
isUnsizedArrayin classType
-
isStruct
public boolean isStruct() -
isInterfaceBlock
public boolean isInterfaceBlock()- Overrides:
isInterfaceBlockin classType
-
isMultiSampled
public boolean isMultiSampled()- Overrides:
isMultiSampledin classType
-
isSampled
public boolean isSampled() -
isCombinedSampler
public boolean isCombinedSampler()- Overrides:
isCombinedSamplerin classType- Returns:
- true for texture with sampler
-
isSeparateSampler
public boolean isSeparateSampler()- Overrides:
isSeparateSamplerin classType- Returns:
- true for pure sampler
-
isStorageImage
public boolean isStorageImage()- Overrides:
isStorageImagein classType- Returns:
- true for image, except subpass input
-
getCoercibleTypes
Description copied from class:TypeFor generic types, returns the types that this generic type can substitute for.- Overrides:
getCoercibleTypesin classType
-
getFields
-