Package icyllis.arc3d.compiler.tree
Class Type.ScalarType
java.lang.Object
icyllis.arc3d.compiler.tree.Node
icyllis.arc3d.compiler.tree.Symbol
icyllis.arc3d.compiler.tree.Type
icyllis.arc3d.compiler.tree.Type.ScalarType
- 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.VectorType
Nested 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 TypeMethodDescriptionint
getCols()
For matrices, returns the number of columns (e.g.int
For type that contains scalars, returns the number of scalars.double
Returns the maximum value that can fit in the type.double
Returns the minimum value that can fit in the type.int
For scalars, returns the minimum size in bits of the type.int
getRank()
Returns the "rank" of a numeric type, in order of float > half > int > short.int
getRows()
For matrices and vectors, returns the number of rows (e.g.byte
Returns the ScalarKind of this type (always NonScalar for non-scalar values).int
getWidth()
For scalars, returns the size in bits of the type.boolean
isScalar()
Methods inherited from class icyllis.arc3d.compiler.tree.Type
canCoerceTo, checkLiteralOutOfRange, coerceExpression, convertArraySize, convertArraySize, getArrayName, getArraySize, getCoercibleTypes, getCoercionCost, getComponentType, getDesc, getDimensions, getElementType, getFields, getKind, getNestingDepth, getType, getTypeKind, isArray, isArrayed, isBoolean, isBooleanOrCompound, isCombinedSampler, isFloat, isFloatOrCompound, isGeneric, isInBuiltinTypes, isInteger, isInterfaceBlock, isMatrix, isMultiSampled, isNumeric, isOpaque, isRelaxedPrecision, isSampled, isSeparateSampler, isShadow, isSigned, isSignedOrCompound, isStorageImage, isStruct, isUnsigned, isUnsignedOrCompound, isUnsizedArray, isUsableInArray, isVector, isVoid, makeAliasType, makeAliasType, makeArrayType, makeCombinedType, makeGenericType, makeImageType, makeMatrixType, makeSamplerType, makeScalarType, makeScalarType, makeSeparateType, makeSpecialType, makeStructType, makeTextureType, makeVectorType, matches, resolve, toCompound, toString, toVector
Methods inherited from class icyllis.arc3d.compiler.tree.Node
getEndOffset, getStartOffset
-
Method Details
-
isScalar
public boolean isScalar() -
getScalarKind
public byte getScalarKind()Description copied from class:Type
Returns the ScalarKind of this type (always NonScalar for non-scalar values).- Overrides:
getScalarKind
in classType
-
getRank
public int getRank()Description copied from class:Type
Returns 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. -
getMinWidth
public int getMinWidth()Description copied from class:Type
For scalars, returns the minimum size in bits of the type.- Overrides:
getMinWidth
in classType
-
getWidth
public int getWidth()Description copied from class:Type
For scalars, returns the size in bits of the type. -
getCols
public int getCols()Description copied from class:Type
For 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:Type
For 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:Type
For type that contains scalars, returns the number of scalars. For all other types, causes an assertion failure.- Overrides:
getComponents
in classType
-
getMinValue
public double getMinValue()Description copied from class:Type
Returns the minimum value that can fit in the type.- Overrides:
getMinValue
in classType
-
getMaxValue
public double getMaxValue()Description copied from class:Type
Returns the maximum value that can fit in the type.- Overrides:
getMaxValue
in classType
-