pub struct CodeDef {
pub name: String,
pub code: String,
pub includes: Vec<NodeRef>,
/* private fields */
}Expand description
A parsed wgslFn — CodeNode plus the WGSLNodeFunction it holds.
Fields§
§name: StringThe name in the declaration, which is also the name it is called by.
code: StringWGSLNodeFunction.getCode(): the rebuilt declaration line followed by
the source’s own block, verbatim.
includes: Vec<NodeRef>CodeNode.includes — the nodes three builds before this one, so
whatever they declare is in scope for the hand-written body. Two kinds
reach it: another wgslFn this one calls, which lands in // codes
ahead of its caller, and a varyingProperty() the body assigns to,
which is how webgpu_tsl_interoperability’s varyings.vUv = uv; gets
vUv into VaryingsStruct without any node ever reading it in the
vertex stage. See docs/nodes.md §20.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for CodeDef
impl !Send for CodeDef
impl !Sync for CodeDef
impl !UnwindSafe for CodeDef
impl Freeze for CodeDef
impl Unpin for CodeDef
impl UnsafeUnpin for CodeDef
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