pub struct Spirv { /* private fields */ }
Expand description
A parsed and analyzed SPIR-V module.
Implementations
sourceimpl Spirv
impl Spirv
sourcepub fn new(words: &[u32]) -> Result<Spirv, SpirvError>
pub fn new(words: &[u32]) -> Result<Spirv, SpirvError>
Parses a SPIR-V document from a list of words.
sourcepub fn instructions(&self) -> &[Instruction]
pub fn instructions(&self) -> &[Instruction]
Returns a reference to the instructions in the module.
sourcepub fn bound(&self) -> u32
pub fn bound(&self) -> u32
Returns the upper bound of Id
s. All Id
s should have a numeric value strictly less than
this value.
sourcepub fn id<'a>(&'a self, id: Id) -> IdInfo<'a>
pub fn id<'a>(&'a self, id: Id) -> IdInfo<'a>
Returns information about an Id
.
Panics
- Panics if
id
is not defined in this module. This can in theory only happpen if you are mixingId
s from different modules.
sourcepub fn iter_capability(&self) -> impl ExactSizeIterator<Item = &Instruction>
pub fn iter_capability(&self) -> impl ExactSizeIterator<Item = &Instruction>
Returns an iterator over all Capability
instructions.
sourcepub fn iter_extension(&self) -> impl ExactSizeIterator<Item = &Instruction>
pub fn iter_extension(&self) -> impl ExactSizeIterator<Item = &Instruction>
Returns an iterator over all Extension
instructions.
sourcepub fn iter_ext_inst_import(
&self
) -> impl ExactSizeIterator<Item = &Instruction>
pub fn iter_ext_inst_import(
&self
) -> impl ExactSizeIterator<Item = &Instruction>
Returns an iterator over all ExtInstImport
instructions.
sourcepub fn memory_model(&self) -> &Instruction
pub fn memory_model(&self) -> &Instruction
Returns the MemoryModel
instruction.
sourcepub fn iter_entry_point(&self) -> impl ExactSizeIterator<Item = &Instruction>
pub fn iter_entry_point(&self) -> impl ExactSizeIterator<Item = &Instruction>
Returns an iterator over all EntryPoint
instructions.
sourcepub fn iter_execution_mode(&self) -> impl ExactSizeIterator<Item = &Instruction>
pub fn iter_execution_mode(&self) -> impl ExactSizeIterator<Item = &Instruction>
Returns an iterator over all execution mode instructions.
sourcepub fn iter_name(&self) -> impl ExactSizeIterator<Item = &Instruction>
pub fn iter_name(&self) -> impl ExactSizeIterator<Item = &Instruction>
Returns an iterator over all name debug instructions.
sourcepub fn iter_decoration(&self) -> impl ExactSizeIterator<Item = &Instruction>
pub fn iter_decoration(&self) -> impl ExactSizeIterator<Item = &Instruction>
Returns an iterator over all decoration instructions.
sourcepub fn iter_global(&self) -> impl ExactSizeIterator<Item = &Instruction>
pub fn iter_global(&self) -> impl ExactSizeIterator<Item = &Instruction>
Returns an iterator over all global declaration instructions: types, constants and global variables.
Note: This can also include Line
and NoLine
instructions.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Spirv
impl Send for Spirv
impl Sync for Spirv
impl Unpin for Spirv
impl UnwindSafe for Spirv
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more