Enum spirq::ty::Type

source ·
#[non_exhaustive]
pub enum Type {
Show 15 variants Scalar(ScalarType), Vector(VectorType), Matrix(MatrixType), Image(ImageType), CombinedImageSampler(CombinedImageSamplerType), SampledImage(SampledImageType), StorageImage(StorageImageType), Sampler(SamplerType), SubpassData(SubpassDataType), Array(ArrayType), Struct(StructType), AccelStruct(AccelStructType), DeviceAddress(DeviceAddressType), DevicePointer(PointerType), RayQuery(RayQueryType),
}

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

Scalar(ScalarType)

A single value, which can be a signed or unsigned integer, a floating point number, or a boolean value.

§

Vector(VectorType)

A collection of scalars.

§

Matrix(MatrixType)

A collection of vectors.

§

Image(ImageType)

An image. In most cases, this variant is elevated to CombinedImageSampler, SampledImage, or StorageImage so you shouldn’t see this in your reflection results.

§

CombinedImageSampler(CombinedImageSamplerType)

A sampled image externally combined with a sampler state. Such design is preferred in OpenGL and Vulkan.

§

SampledImage(SampledImageType)

A sampled image yet to be combined with a Sampler. Such design is preferred in DirectX and Vulkan.

§

StorageImage(StorageImageType)

A storage image that shaders can read and/or write.

§

Sampler(SamplerType)

Separable sampler state.

§

SubpassData(SubpassDataType)

Pixel store from input attachments.

§

Array(ArrayType)

Repetition of a single type.

§

Struct(StructType)

Aggregation of types.

§

AccelStruct(AccelStructType)

Acceleration structure for ray-tracing. Only available with RayTracingKHR capability enabled.

§

DeviceAddress(DeviceAddressType)

Forward-declared pointer but the type of pointed data is unknown. Usually used for GPU linked lists. See VK_KHR_buffer_device_address.

§

DevicePointer(PointerType)

Forward-declared pointer. Usually used for bindless resources with the buffer_reference extension. See VK_KHR_buffer_device_address.

§

RayQuery(RayQueryType)

Ray query payload type (rayQueryEXT). Only available with RayQueryKHR capability enabled.

Implementations§

source§

impl Type

source

pub fn min_nbyte(&self) -> Option<usize>

source

pub fn nbyte(&self) -> Option<usize>

source

pub fn member_offset(&self, member_index: usize) -> Option<usize>

source

pub fn access_ty(&self) -> Option<AccessType>

source

pub fn walk<'a>(&'a self) -> Walk<'a>

source

pub fn is_scalar(&self) -> bool

source

pub fn is_vector(&self) -> bool

source

pub fn is_matrix(&self) -> bool

source

pub fn is_image(&self) -> bool

source

pub fn is_sampler(&self) -> bool

source

pub fn is_combined_image_sampler(&self) -> bool

source

pub fn is_sampled_image(&self) -> bool

source

pub fn is_storage_image(&self) -> bool

source

pub fn is_subpass_data(&self) -> bool

source

pub fn is_array(&self) -> bool

source

pub fn is_struct(&self) -> bool

source

pub fn is_accel_struct(&self) -> bool

source

pub fn is_device_address(&self) -> bool

source

pub fn is_device_pointer(&self) -> bool

source

pub fn as_scalar(&self) -> Option<&ScalarType>

source

pub fn as_vector(&self) -> Option<&VectorType>

source

pub fn as_matrix(&self) -> Option<&MatrixType>

source

pub fn as_image(&self) -> Option<&ImageType>

source

pub fn as_sampler(&self) -> Option<&SamplerType>

source

pub fn as_combined_image_sampler(&self) -> Option<&CombinedImageSamplerType>

source

pub fn as_sampled_image(&self) -> Option<&SampledImageType>

source

pub fn as_storage_image(&self) -> Option<&StorageImageType>

source

pub fn as_subpass_data(&self) -> Option<&SubpassDataType>

source

pub fn as_array(&self) -> Option<&ArrayType>

source

pub fn as_struct(&self) -> Option<&StructType>

source

pub fn as_accel_struct(&self) -> Option<&AccelStructType>

source

pub fn as_device_address(&self) -> Option<&DeviceAddressType>

source

pub fn as_device_pointer(&self) -> Option<&PointerType>

source

pub fn mutate<F>(self, f: F) -> Type
where F: Fn(Type) -> Type,

Trait Implementations§

source§

impl Clone for Type

source§

fn clone(&self) -> Type

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 Debug for Type

source§

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

Formats the value using the given formatter. Read more
source§

impl Display for Type

source§

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

Formats the value using the given formatter. Read more
source§

impl Hash for Type

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Type

source§

fn eq(&self, other: &Type) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Type

source§

impl StructuralPartialEq for Type

Auto Trait Implementations§

§

impl Freeze for Type

§

impl RefUnwindSafe for Type

§

impl Send for Type

§

impl Sync for Type

§

impl Unpin for Type

§

impl UnwindSafe for Type

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> 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,

§

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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>,

§

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.