enum Indirection {
Ordinary,
Reference,
}
Expand description
The WGSL form that write_expr_with_indirection
should use to render a Naga
expression.
Sometimes a Naga Expression
alone doesn’t provide enough information to
choose the right rendering for it in WGSL. For example, one natural WGSL
rendering of a Naga LocalVariable(x)
expression might be &x
, since
LocalVariable
produces a pointer to the local variable’s storage. But when
rendering a Store
statement, the pointer
operand must be the left hand
side of a WGSL assignment, so the proper rendering is x
.
The caller of write_expr_with_indirection
must provide an Expected
value
to indicate how ambiguous expressions should be rendered.
Variants§
Ordinary
Render pointer-construction expressions as WGSL ptr
-typed expressions.
This is the right choice for most cases. Whenever a Naga pointer
expression is not the pointer
operand of a Load
or Store
, it
must be a WGSL pointer expression.
Reference
Render pointer-construction expressions as WGSL reference-typed expressions.
For example, this is the right choice for the pointer
operand when
rendering a Store
statement as a WGSL assignment.
Trait Implementations§
source§impl Clone for Indirection
impl Clone for Indirection
source§fn clone(&self) -> Indirection
fn clone(&self) -> Indirection
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Indirection
impl Debug for Indirection
impl Copy for Indirection
Auto Trait Implementations§
impl Freeze for Indirection
impl RefUnwindSafe for Indirection
impl Send for Indirection
impl Sync for Indirection
impl Unpin for Indirection
impl UnwindSafe for Indirection
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)