#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

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

length: Option<u32>

length of the array (if known)

Either a static array with known length (length is Some) or dynamic array with unknown length (length is None)

Struct

Fields

name: Option<String>
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

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.