pub struct RenderGraph { /* private fields */ }Expand description
Linear chain of render nodes executed in insertion order.
The CPU fallback path (process_cpu) is always
available and does not require the wgpu feature. When the wgpu feature
is enabled, process_gpu runs every node on the GPU.
§Construction
ⓘ
// GPU+CPU graph (wgpu feature):
let ctx = Arc::new(RenderContext::init().await?);
let graph = RenderGraph::new(Arc::clone(&ctx))
.push(ColorGradeNode { brightness: 0.1, ..Default::default() });
// CPU-only graph (no wgpu feature needed):
let graph = RenderGraph::new_cpu()
.push_cpu(ColorGradeNode { brightness: 0.1, ..Default::default() });Implementations§
Source§impl RenderGraph
impl RenderGraph
Sourcepub fn new_cpu() -> Self
pub fn new_cpu() -> Self
Create a CPU-only graph (no GPU context required).
process_gpu returns [RenderError::Composite]
when called on a CPU-only graph. Use process_cpu
instead.
Sourcepub fn push(self, node: impl RenderNodeCpu + 'static) -> Self
pub fn push(self, node: impl RenderNodeCpu + 'static) -> Self
Append a CPU-only node to the chain.
CPU-only nodes participate in process_cpu but
not in process_gpu.
When the wgpu feature is not enabled, this is the only push method.
Sourcepub fn push_cpu(self, node: impl RenderNodeCpu + 'static) -> Self
pub fn push_cpu(self, node: impl RenderNodeCpu + 'static) -> Self
Append a CPU-only node (available regardless of the wgpu feature).
Auto Trait Implementations§
impl Freeze for RenderGraph
impl !RefUnwindSafe for RenderGraph
impl Send for RenderGraph
impl !Sync for RenderGraph
impl Unpin for RenderGraph
impl UnsafeUnpin for RenderGraph
impl !UnwindSafe for RenderGraph
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