enum BodyFragment {
BlockId(Word),
If {
condition: Handle<Expression>,
accept: usize,
reject: usize,
},
Loop {
body: usize,
continuing: usize,
break_if: Option<Handle<Expression>>,
},
Switch {
selector: Handle<Expression>,
cases: Vec<(i32, usize)>,
default: usize,
},
Break,
Continue,
}
Expand description
An intermediate representation of a Naga Statement
.
Body
and BodyFragment
values form a tree: the BodyIndex
fields of the
variants are indices of the child Body
values in BlockContext::bodies
.
The lower
function assembles the final Statement
tree from this Body
tree. See BlockContext
for details.
Variants§
BlockId(Word)
If
Loop
Fields
§
body: usize
The body of the loop. Its Body::parent
is the block containing
this Loop
fragment.
§
continuing: usize
The loop’s continuing block. This is a grandchild: its
Body::parent
is the loop body block, whose index is above.
§
break_if: Option<Handle<Expression>>
If the SPIR-V loop’s back-edge branch is conditional, this is the
expression that must be false
for the back-edge to be taken, with
true
being for the “loop merge” (which breaks out of the loop).
Switch
Break
Continue
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BodyFragment
impl RefUnwindSafe for BodyFragment
impl Send for BodyFragment
impl Sync for BodyFragment
impl Unpin for BodyFragment
impl UnwindSafe for BodyFragment
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