pub struct GpuFrameSink { /* private fields */ }Expand description
A FrameSink that processes each frame through a RenderGraph before
forwarding to a downstream sink.
When the wgpu feature is enabled and the graph was created with a GPU
context, the GPU pipeline runs. On GPU error the unprocessed frame is
forwarded as a fallback.
When the wgpu feature is not enabled (or the graph is CPU-only), the
CPU fallback pipeline runs transparently.
§Example
ⓘ
let ctx = Arc::new(RenderContext::init().await?);
let graph = RenderGraph::new(ctx)
.push(ColorGradeNode { brightness: 0.2, ..Default::default() });
let sink = GpuFrameSink::new(graph, Box::new(RgbaSink::new()));
runner.set_sink(Box::new(sink));Implementations§
Source§impl GpuFrameSink
impl GpuFrameSink
Sourcepub fn new(graph: RenderGraph, downstream: Box<dyn FrameSink>) -> Self
pub fn new(graph: RenderGraph, downstream: Box<dyn FrameSink>) -> Self
Construct a sink that applies graph to every incoming frame and
forwards the result to downstream.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GpuFrameSink
impl !RefUnwindSafe for GpuFrameSink
impl Send for GpuFrameSink
impl !Sync for GpuFrameSink
impl Unpin for GpuFrameSink
impl UnsafeUnpin for GpuFrameSink
impl !UnwindSafe for GpuFrameSink
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