[naga] Document the absence of "phi" expressions.

This commit is contained in:
Jim Blandy 2024-03-06 07:03:51 -08:00 committed by Teodor Tanasoaia
parent 8ee3c414f0
commit 14dbf8c60e

View File

@ -1687,6 +1687,10 @@ pub enum Statement {
/// A block containing more statements, to be executed sequentially.
Block(Block),
/// Conditionally executes one of two blocks, based on the value of the condition.
///
/// Naga IR does not have "phi" instructions. If you need to use
/// values computed in an `accept` or `reject` block after the `If`,
/// store them in a [`LocalVariable`].
If {
condition: Handle<Expression>, //bool
accept: Block,
@ -1706,6 +1710,10 @@ pub enum Statement {
/// represented in the IR as a series of fallthrough cases with empty
/// bodies, except for the last.
///
/// Naga IR does not have "phi" instructions. If you need to use
/// values computed in a [`SwitchCase::body`] block after the `Switch`,
/// store them in a [`LocalVariable`].
///
/// [`value`]: SwitchCase::value
/// [`body`]: SwitchCase::body
/// [`Default`]: SwitchValue::Default
@ -1740,6 +1748,10 @@ pub enum Statement {
/// if" statement in WGSL, or a loop whose back edge is an
/// `OpBranchConditional` instruction in SPIR-V.
///
/// Naga IR does not have "phi" instructions. If you need to use
/// values computed in a `body` or `continuing` block after the
/// `Loop`, store them in a [`LocalVariable`].
///
/// [`Break`]: Statement::Break
/// [`Continue`]: Statement::Continue
/// [`Kill`]: Statement::Kill