ConcreteType¶
Overview¶
Represents a data type that can be serialized/deserialized to/from a binary form, both in TypeScript and in WGSL.
@author Jonathan Olson <jonathan.olson@colorado.edu>
Type ConcreteType¶
- name: string
- bytesPerElement: number
TODO: deduplicate with wgslSize/wgslAlign. This is the size of the ENTIRE type, drop the "element" bit - outOfRangeElement?: T
- equals: ( a: T, b: T ) => boolean
TS - equalsWGSL: ( a: WGSLExpressionT, b: WGSLExpressionT ) => WGSLExpressionBool
WGSL - valueType: WGSLType
WGSL representation TODO: consider rename to valueTypeWGSL? - wgslAlign: number
See https://www.w3.org/TR/WGSL/#alignment-and-size - wgslSize: number
Type BinaryOp¶
- name: string
- type: ConcreteType<T>
- isCommutative: boolean
- identity: T
TS - apply: ( a: T, b: T ) => T
- identityWGSL: WGSLExpressionT
WGSL - combineExpression?: ( a: WGSLExpressionT, b: WGSLExpressionT ) => WGSLExpressionT
- combineStatements?: ( varName: WGSLVariableName, a: WGSLExpressionT, b: WGSLExpressionT ) => WGSLStatements
TODO: Don't have this, if needed just rely on a function placed on the blueprint(!) TODO: remove this(!) - atomicName?: string
Type BitOrder¶
- name: string
- type: ConcreteType<T>
- getBits: ( value: T, bitOffset: number, bitQuantity: number ) => number
TS - getBitsWGSL: ( value: WGSLExpressionT, bitOffset: number, bitQuantity: number ) => WGSLExpressionU32
WGSL
Type CompareOrder¶
- name: string
- type: ConcreteType<T>
- compare: ( a: T, b: T ) => number
TS - compareWGSL: ( a: WGSLExpressionT, b: WGSLExpressionT ) => WGSLExpressionI32
WGSL - greaterThanWGSL: ( a: WGSLExpressionT, b: WGSLExpressionT ) => WGSLExpressionBool
- lessThanOrEqualWGSL: ( a: WGSLExpressionT, b: WGSLExpressionT ) => WGSLExpressionBool
Type ConcreteArrayType¶
Type Order¶
BitOrder<T> & CompareOrder<T>
Type StoreStatementCallback¶
( offset: WGSLExpressionU32, u32expr: WGSLExpressionU32 ) => WGSLStatements
Type WGSLBinaryStatements¶
( value: WGSLVariableName, a: WGSLExpression, b: WGSLExpression ) => WGSLStatements
Source Code¶
See the source for ConcreteType.ts in the alpenglow repository.