pub struct Builder { /* private fields */ }Expand description
Accumulates SPIR-V words per section and hands out result ids.
Implementations§
Source§impl Builder
impl Builder
pub fn new() -> Self
Sourcepub fn inst(&mut self, s: Section, op: u16, operands: &[u32])
pub fn inst(&mut self, s: Section, op: u16, operands: &[u32])
Emit one instruction with no result id.
Sourcepub fn typed(
&mut self,
s: Section,
op: u16,
result_type: u32,
rest: &[u32],
) -> u32
pub fn typed( &mut self, s: Section, op: u16, result_type: u32, rest: &[u32], ) -> u32
Emit one instruction whose operands are [result_type, result_id, ..rest] and return result_id.
Sourcepub fn result(&mut self, s: Section, op: u16, rest: &[u32]) -> u32
pub fn result(&mut self, s: Section, op: u16, rest: &[u32]) -> u32
Emit one instruction whose only leading operand is its result id
(OpTypeInt, OpLabel, …) and return that id.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnsafeUnpin for Builder
impl UnwindSafe for Builder
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