[−][src]Struct rspirv::dr::Module
Data representation of a SPIR-V module.
Most of the fields are just vectors of Instruction
s, but some fields
store values decomposed from Instruction
s for better investigation.
The order of its fields basically reveal the requirements in the Logical Layout of a Module of the SPIR-V of the SPIR-V specification.
Fields
header: Option<ModuleHeader>
The module header.
capabilities: Vec<Instruction>
All OpCapability instructions.
extensions: Vec<Instruction>
All OpExtension instructions.
ext_inst_imports: Vec<Instruction>
All OpExtInstImport instructions.
memory_model: Option<Instruction>
The OpMemoryModel instruction.
Although it is required by the specification to appear exactly once per module, we keep it optional here to allow flexibility.
entry_points: Vec<Instruction>
All entry point declarations, using OpEntryPoint.
execution_modes: Vec<Instruction>
All execution mode declarations, using OpExecutionMode.
debugs: Vec<Instruction>
All non-location debug instructions.
annotations: Vec<Instruction>
All annotation instructions.
types_global_values: Vec<Instruction>
All types, constants, and global variables.
As per the specification, they have to be bundled together because they can depend on one another.
functions: Vec<Function>
All functions.
Implementations
impl Module
[src]
pub fn new() -> Self
[src]
Creates a new empty Module
instance.
pub fn global_inst_iter(&self) -> impl Iterator<Item = &Instruction>
[src]
Returns an iterator over all global instructions.
This method internally creates a vector of references to all global instructions, therefore it has some overheads.
Trait Implementations
impl Assemble for Module
[src]
impl Clone for Module
[src]
impl Debug for Module
[src]
impl Default for Module
[src]
impl Disassemble for Module
[src]
fn disassemble(&self) -> String
[src]
Disassembles this module and returns the disassembly text.
This method will try to link information together to be wise. E.g., If the extended instruction set is recognized, the symbolic opcode for instructions in it will be shown.
Auto Trait Implementations
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnwindSafe for Module
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,