#[non_exhaustive]pub struct ComputeFlow {
pub statements: Vec<NodeRef>,
pub count: usize,
pub workgroup_size: [u32; 3],
pub name: Option<String>,
pub on_init: Option<Box<ComputeFlow>>,
}Expand description
One ComputeNode — Fn( () => { … } )().compute( count, workgroupSize ).
Built with ComputeFlow::new, which takes the two things three’s
.compute() cannot default; the rest are fields to set afterwards
(docs/api.md decision 3).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.statements: Vec<NodeRef>The kernel body’s statements, in order.
count: usize.compute( count ) — the number of invocations the kernel is for, and
the bound the generated early-return checks instanceIndex against,
unless the kernel has a barrier (docs/nodes.md §84.6).
workgroup_size: [u32; 3]ComputeNode’s workgroupSize, padded to three components exactly as
computeKernel( node, workgroupSize = [ 64 ] ) pads it.
name: Option<String>computeNode.setName( … ).
on_init: Option<Box<ComputeFlow>>computeNode.onInit — a second kernel the renderer runs once,
before the first dispatch of this one, in its own command encoder and
its own submit.
Implementations§
Trait Implementations§
Source§impl Clone for ComputeFlow
impl Clone for ComputeFlow
Source§impl Debug for ComputeFlow
impl Debug for ComputeFlow
Source§impl NodeUpdate for ComputeFlow
ComputeNode.updateBefore( frame ): frame.renderer.compute( this ),
with updateBeforeType = NodeUpdateType.FRAME — a kernel a material reads
as a value runs once a frame, before the first draw that reads it.
impl NodeUpdate for ComputeFlow
ComputeNode.updateBefore( frame ): frame.renderer.compute( this ),
with updateBeforeType = NodeUpdateType.FRAME — a kernel a material reads
as a value runs once a frame, before the first draw that reads it.
Source§fn update_before_type(&self) -> NodeUpdateType
fn update_before_type(&self) -> NodeUpdateType
getUpdateBeforeType().Source§fn update_before(&self, renderer: &mut Renderer) -> bool
fn update_before(&self, renderer: &mut Renderer) -> bool
updateBefore( frame ): before the draw that reaches the node. A pass
renders its scene here.Source§fn update_type(&self) -> NodeUpdateType
fn update_type(&self) -> NodeUpdateType
getUpdateType().Source§fn update_after_type(&self) -> NodeUpdateType
fn update_after_type(&self) -> NodeUpdateType
getUpdateAfterType().Source§fn update(&self, _renderer: &mut Renderer) -> bool
fn update(&self, _renderer: &mut Renderer) -> bool
update( frame ): while the draw’s bindings are updated.Source§fn update_after(&self, _renderer: &mut Renderer) -> bool
fn update_after(&self, _renderer: &mut Renderer) -> bool
updateAfter( frame ): after the draw.Source§fn sync_before_build(&self, _samples: u32)
fn sync_before_build(&self, _samples: u32)
PassNode.setup() sets renderTarget.samples = renderer.samples
while the graph that reaches the pass is analyzed — before any pass
renders. That is what lets a composite bind the pass’s depth texture
as texture_depth_multisampled_2d on the very build that discovers
it. The port has no per-node setup() hook (docs/nodes.md §57.2),
so sync_before_build stands in for it: it
runs on every node with a live texture registration, right before
Renderer builds a material’s program,
which is the earliest point the builder can see a pass’s textures.
PassNode is the only node that overrides it
(docs/nodes.md §57.5); the default is a no-op.