Skip to main content

FrameGraph

Struct FrameGraph 

Source
pub struct FrameGraph { /* private fields */ }
Expand description

Long-lived owner of frame identities, transient allocations, and GPU timing state.

Use FrameGraph::new for CPU-only recording and compilation. Use FrameGraph::with_device when compiled frames will be executed. Only one Frame may borrow a graph at a time; dropping or compiling it permits the next recording to begin.

Implementations§

Source§

impl FrameGraph

Source

pub fn new() -> Self

Creates a CPU-only graph compiler.

Frames from this graph can be recorded, validated, compiled, reported, and exported, but CompiledFrame::execute returns FrameGraphError::MissingGpuDevice.

Source

pub fn with_device(device: &Device) -> Self

Creates a graph backed by a cloned wgpu device handle.

The graph owns its transient resource pool and GPU timing resources. The queue, imported resources, pipelines, bind groups, and surface remain caller-owned. Native objects supplied for execution must belong to this device. Device-specific limits and native object ownership are checked by wgpu during allocation or execution, not by graph recording. Graph recording still validates logical ranges, content flow, usage contracts, format categories, and bounded planning inputs.

Source

pub fn resource_pool_stats(&self) -> ResourcePoolStats

Returns cumulative allocation counters and current retained pool size.

Source

pub fn clear_resource_pool(&mut self)

Destroys all transient resources currently retained for reuse.

Cumulative acquire, reuse, and creation counters are preserved.

Source

pub fn begin_frame(&mut self) -> Frame<'_>

Begins a fresh, single-use frame recording.

Logical handles returned by the frame cannot outlive this exclusive graph borrow. Frame::compile consumes the recording and returns a compiled frame that continues to hold the graph borrow through optional execution.

Trait Implementations§

Source§

impl Debug for FrameGraph

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FrameGraph

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,