Enum spirv_layout::Type
source · [−]#[non_exhaustive]
pub enum Type {
Show 17 variants
Unknown,
Void,
Bool,
Int32,
UInt32,
Float32,
Vec2,
Vec3,
Vec4,
Mat3,
Mat4,
Image2D {
depth: bool,
sampled: bool,
format: u32,
},
Sampler,
SampledImage {
image_type_id: u32,
},
Array {
element_type_id: u32,
length: Option<u32>,
},
Struct {
name: Option<String>,
elements: Vec<StructMember>,
},
Pointer {
storage_class: StorageClass,
pointed_type_id: u32,
},
}
Expand description
Represents a type declared in a SPIRV module.
Types are declared in a hierarchy, with e.g. pointers relying on previously declared types as pointed-to types.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Unknown
An unsupported type
Void
The Void type
Bool
A boolean
Int32
A signed 32-Bit integer
UInt32
An unsigned 32-Bit integer
Float32
A 32-Bit float
Vec2
A 2 component, 32-Bit vector (GLSL: vec2)
Vec3
A 3 component, 32-Bit vector (GLSL: vec3)
Vec4
A 4 component, 32-Bit vector (GLSL: vec4)
Mat3
A 3x3, 32-Bit Matrix (GLSL: mat3)
Mat4
A 4x4, 32-Bit Matrix (GLSL: mat4)
Image2D
Fields
depth: bool
true if this image is a depth image
sampled: bool
true if this image can be sampled from
format: u32
SPIRV code of the images format (should always be 0 in Vulkan)
A 2D image
Sampler
An opaque sampler object
SampledImage
Fields
image_type_id: u32
type id of the image contained in the SampledImage
A combined image and sampler (Vulkan: CombinedImageSampler descriptor)
Array
Fields
element_type_id: u32
type id of the contained type
Either a static array with known length (length
is Some
) or dynamic array with unknown length (length
is None
)
Struct
Fields
elements: Vec<StructMember>
members of the struct, in the order they appear in the SPIRV module (not necessarily ascending offsets)
A struct containing other types
Pointer
Fields
storage_class: StorageClass
The type of storage this pointer points to
pointed_type_id: u32
The type id of the pointed-to type
A pointer pointing to another type