pub enum TypeInner<'a> {
Unknown,
Void,
Pointer {
base: Handle<TypeId>,
storage: StorageClass,
forward: bool,
},
Struct(StructType<'a>),
Scalar(Scalar),
Vector {
width: u32,
scalar: Scalar,
},
Matrix {
columns: u32,
rows: u32,
scalar: Scalar,
},
Array {
base: Handle<TypeId>,
storage: StorageClass,
dimensions: Vec<ArrayDimension>,
stride: Option<u32>,
},
Image(ImageType),
AccelerationStructure,
Sampler,
}Expand description
Enum with additional type information, depending on the kind of type.
The design of this API is inspired heavily by naga::TypeInner,
with some changes to fit SPIR-V.
Variants§
Unknown
Unknown type.
Void
The void type.
Pointer
A pointer to another type.
Atomics are represented as TypeInner::Pointer with
the storage class StorageClass::AtomicCounter.
Fields
storage: StorageClassThe storage class of the pointer.
Atomics are represented as TypeInner::Pointer with
the storage class StorageClass::AtomicCounter.
Struct(StructType<'a>)
A struct type.
Scalar(Scalar)
A scalar type.
Vector
A vector type.
For example, vec4 would have a width of 4,
and a scalar type with ScalarKind::Float and bit-width 32.
Matrix
A matrix type.
For example, mat4 would have 4 columns, 4 rows,
and a scalar type with ScalarKind::Float and bit-width 32.
Fields
Array
An array type.
Fields
storage: StorageClassThe storage class of the array.
dimensions: Vec<ArrayDimension>The dimensions of the array.
Most of the time, these will be ArrayDimension::Literal.
If an array dimension is specified as a specialization constant,
then the dimension will be ArrayDimension::Constant.
The order of dimensions follow SPIR-V semantics, i.e. backwards compared to C-style declarations.
i.e. int a[4][6] will return as [Linear(6), Linear(4)].
Image(ImageType)
A texture or image handle.
AccelerationStructure
An opaque acceleration structure.
Sampler
An opaque sampler.