pub trait RenderNode: RenderNodeCpu {
// Required method
fn process(
&self,
inputs: &[&Texture],
outputs: &[&Texture],
ctx: &RenderContext,
);
// Provided methods
fn input_count(&self) -> usize { ... }
fn pass_count(&self) -> usize { ... }
}Expand description
GPU render node. Extends RenderNodeCpu so both paths are available.
Each node is responsible for creating and caching its own wgpu pipeline
on first use. The pipeline is stored in a std::sync::OnceLock field
so it is created exactly once per node instance.
process may submit one or more wgpu::CommandEncoder buffers. The
RenderGraph guarantees that the queue
processes them in submission order.
Required Methods§
Sourcefn process(
&self,
inputs: &[&Texture],
outputs: &[&Texture],
ctx: &RenderContext,
)
fn process( &self, inputs: &[&Texture], outputs: &[&Texture], ctx: &RenderContext, )
Run the GPU render pass.
inputs[i] are the source textures (len == input_count()).
outputs[i] are pre-allocated Rgba8Unorm target textures
(len == pass_count()). Write the final result into outputs[pass_count()-1].
Provided Methods§
Sourcefn input_count(&self) -> usize
fn input_count(&self) -> usize
Number of input textures required by this node (default: 1).
Sourcefn pass_count(&self) -> usize
fn pass_count(&self) -> usize
Number of render passes (default: 1). Multi-pass nodes (e.g. gaussian blur) return 2 or more.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl RenderNode for AlphaMatteNode
wgpu only.impl RenderNode for BlendModeNode
wgpu only.impl RenderNode for ChromaKeyNode
wgpu only.impl RenderNode for ColorGradeNode
wgpu only.impl RenderNode for CrossfadeNode
wgpu only.impl RenderNode for LumaMaskNode
wgpu only.impl RenderNode for OverlayNode
wgpu only.impl RenderNode for ScaleNode
wgpu only.impl RenderNode for ShapeMaskNode
wgpu only.impl RenderNode for TransformNode
wgpu only.impl RenderNode for YuvUploadNode
wgpu only.