Trait spirq::prelude::SpirvType

source ·
pub trait SpirvType {
    // Required method
    fn min_nbyte(&self) -> Option<usize>;

    // Provided methods
    fn nbyte(&self) -> Option<usize> { ... }
    fn is_sized(&self) -> bool { ... }
    fn member_offset(&self, _member_index: usize) -> Option<usize> { ... }
    fn access_ty(&self) -> Option<AccessType> { ... }
}

Required Methods§

source

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

Minimum size of the type in bytes if it can be represented in-memory. It’s the size of all static members and plus one element if it’s an array. Same as wgpu::BindingType::Buffer::min_binding_size.

Provided Methods§

source

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

Size of the type in bytes if it can be represented in-memory.

source

fn is_sized(&self) -> bool

Returns true if the type is sized. A sized type can be represented in-memory. Otherwise the type can only be used as a descriptor resource.

source

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

Returns the offset of the i-th member in bytes if it’s a composite type.

source

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

Returns how the type can be accessed: ReadOnly, WriteOnly or ReadWrite.

Implementors§