Enum spirq::ty::ScalarType
source · pub enum ScalarType {
Void,
Boolean,
Integer {
bits: u32,
is_signed: bool,
},
Float {
bits: u32,
},
}
Variants§
Void
Pseudo-type representing no data. It’s sometimes used to represent data without a type hint at compile-time in SPIR-V. You shouldn’t see this in your reflection results.
Boolean
Boolean value of either true or false. Be careful with booleans. Booleans is NOT allowed to be exposed to the host according to the SPIR-V specification. You shouldn’t see this in your reflection results.
Integer
Two’s complement integer.
Float
IEEE 754 floating-point number.
Implementations§
source§impl ScalarType
impl ScalarType
sourcepub fn int(bits: u32) -> ScalarType
pub fn int(bits: u32) -> ScalarType
Create a signed integer type with the given number of bits.
sourcepub fn uint(bits: u32) -> ScalarType
pub fn uint(bits: u32) -> ScalarType
Create an unsigned integer type with the given number of bits.
sourcepub fn float(bits: u32) -> ScalarType
pub fn float(bits: u32) -> ScalarType
Create a floating point type with the given number of bits.
sourcepub fn i32() -> ScalarType
pub fn i32() -> ScalarType
Create a 32-bit signed integer type.
sourcepub fn u32() -> ScalarType
pub fn u32() -> ScalarType
Create a 32-bit unsigned integer type.
sourcepub fn f32() -> ScalarType
pub fn f32() -> ScalarType
Create a 32-bit floating-point type.
Trait Implementations§
source§impl Clone for ScalarType
impl Clone for ScalarType
source§fn clone(&self) -> ScalarType
fn clone(&self) -> ScalarType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ScalarType
impl Debug for ScalarType
source§impl Display for ScalarType
impl Display for ScalarType
source§impl Hash for ScalarType
impl Hash for ScalarType
source§impl PartialEq for ScalarType
impl PartialEq for ScalarType
source§fn eq(&self, other: &ScalarType) -> bool
fn eq(&self, other: &ScalarType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl SpirvType for ScalarType
impl SpirvType for ScalarType
source§fn min_nbyte(&self) -> Option<usize>
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
.source§fn nbyte(&self) -> Option<usize>
fn nbyte(&self) -> Option<usize>
Size of the type in bytes if it can be represented in-memory.
source§fn is_sized(&self) -> bool
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>
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>
fn access_ty(&self) -> Option<AccessType>
Returns how the type can be accessed:
ReadOnly
, WriteOnly
or
ReadWrite
.impl Eq for ScalarType
impl StructuralPartialEq for ScalarType
Auto Trait Implementations§
impl Freeze for ScalarType
impl RefUnwindSafe for ScalarType
impl Send for ScalarType
impl Sync for ScalarType
impl Unpin for ScalarType
impl UnwindSafe for ScalarType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more