Enum spirv_cross2::reflect::TypeInner

source ·
pub enum TypeInner<'a> {
    Unknown,
    Void,
    Pointer {
        base: Handle<TypeId>,
        storage: StorageClass,
    },
    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>,
    },
    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

§base: Handle<TypeId>

A handle to the base type this points to.

§storage: StorageClass

The 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.

Fields

§width: u32

The width of the vector.

§scalar: Scalar

The scalar type of the vector.

§

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

§columns: u32

The number of columns of the matrix type.

§rows: u32

The number of rows of the matrix type.

§scalar: Scalar

The scalar type of the matrix.

§

Array

An array type.

Fields

§base: Handle<TypeId>

The base type that the type is an array of.

§storage: StorageClass

The 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.

Trait Implementations§

source§

impl<'a> Clone for TypeInner<'a>

source§

fn clone(&self) -> TypeInner<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for TypeInner<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for TypeInner<'a>

§

impl<'a> RefUnwindSafe for TypeInner<'a>

§

impl<'a> !Send for TypeInner<'a>

§

impl<'a> !Sync for TypeInner<'a>

§

impl<'a> Unpin for TypeInner<'a>

§

impl<'a> UnwindSafe for TypeInner<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.