pub struct SpirVFunction {
pub id: u32,
pub return_type_id: u32,
pub function_type_id: u32,
pub name: Option<String>,
pub params: Vec<(u32, u32)>,
pub blocks: Vec<SpirVBasicBlock>,
pub is_entry_point: bool,
pub execution_model: Option<ExecutionModel>,
}Expand description
A SPIR-V function definition.
Fields§
§id: u32Function result ID
return_type_id: u32Function return type ID
function_type_id: u32Function type ID (full signature)
name: Option<String>Debug name (from OpName)
params: Vec<(u32, u32)>Parameter IDs (one per OpFunctionParameter)
blocks: Vec<SpirVBasicBlock>Basic blocks (first is entry block)
is_entry_point: boolWhether this is an entry point
execution_model: Option<ExecutionModel>Execution model (if entry point)
Implementations§
Source§impl SpirVFunction
impl SpirVFunction
Sourcepub fn new(
id: u32,
name: Option<String>,
return_type_id: u32,
function_type_id: u32,
) -> Self
pub fn new( id: u32, name: Option<String>, return_type_id: u32, function_type_id: u32, ) -> Self
Create a new function.
Sourcepub fn add_block(&mut self, block: SpirVBasicBlock)
pub fn add_block(&mut self, block: SpirVBasicBlock)
Add a basic block.
Sourcepub fn set_entry_point(&mut self, model: ExecutionModel)
pub fn set_entry_point(&mut self, model: ExecutionModel)
Mark as an entry point.
Sourcepub fn total_instrs(&self) -> usize
pub fn total_instrs(&self) -> usize
Get the number of instructions across all blocks.
Trait Implementations§
Source§impl Clone for SpirVFunction
impl Clone for SpirVFunction
Source§fn clone(&self) -> SpirVFunction
fn clone(&self) -> SpirVFunction
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for SpirVFunction
impl RefUnwindSafe for SpirVFunction
impl Send for SpirVFunction
impl Sync for SpirVFunction
impl Unpin for SpirVFunction
impl UnsafeUnpin for SpirVFunction
impl UnwindSafe for SpirVFunction
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