pub struct RenderTaskGraphBuilder {
    tasks: Vec<RenderTask>,
    roots: HashSet<RenderTaskId, BuildHasherDefault<FxHasher>>,
    frame_id: FrameId,
    textures_to_free: HashSet<CacheTextureId, BuildHasherDefault<FxHasher>>,
    active_surfaces: FastHashMap<CacheTextureId, Surface>,
}Expand description
The persistent interface that is used during frame building to construct the frame graph.
Fields§
§tasks: Vec<RenderTask>List of tasks added to the builder
roots: HashSet<RenderTaskId, BuildHasherDefault<FxHasher>>List of task roots
frame_id: FrameIdCurrent frame id, used for debug validation
textures_to_free: HashSet<CacheTextureId, BuildHasherDefault<FxHasher>>A list of texture surfaces that can be freed at the end of a pass. Retained here to reduce heap allocations.
active_surfaces: FastHashMap<CacheTextureId, Surface>Implementations§
Source§impl RenderTaskGraphBuilder
 
impl RenderTaskGraphBuilder
Sourcepub fn new() -> Self
 
pub fn new() -> Self
Construct a new graph builder. Typically constructed once and maintained over many frames, to avoid extra heap allocations where possible.
pub fn frame_id(&self) -> FrameId
Sourcepub fn begin_frame(&mut self, frame_id: FrameId)
 
pub fn begin_frame(&mut self, frame_id: FrameId)
Begin a new frame
Sourcepub fn get_task(&self, task_id: RenderTaskId) -> &RenderTask
 
pub fn get_task(&self, task_id: RenderTaskId) -> &RenderTask
Get immutable access to a task
Sourcepub fn get_task_mut(&mut self, task_id: RenderTaskId) -> &mut RenderTask
 
pub fn get_task_mut(&mut self, task_id: RenderTaskId) -> &mut RenderTask
Get mutable access to a task
Sourcepub fn add(&mut self) -> RenderTaskAllocation<'_>
 
pub fn add(&mut self) -> RenderTaskAllocation<'_>
Add a new task to the graph.
Sourcepub fn add_dependency(&mut self, task_id: RenderTaskId, input: RenderTaskId)
 
pub fn add_dependency(&mut self, task_id: RenderTaskId, input: RenderTaskId)
Express a dependency, such that task_id depends on input as a texture source.
Sourcepub fn end_frame(
    &mut self,
    resource_cache: &mut ResourceCache,
    gpu_cache: &mut GpuCache,
    deferred_resolves: &mut Vec<DeferredResolve, FrameAllocator>,
    max_shared_surface_size: i32,
    memory: &FrameMemory,
) -> RenderTaskGraph
 
pub fn end_frame( &mut self, resource_cache: &mut ResourceCache, gpu_cache: &mut GpuCache, deferred_resolves: &mut Vec<DeferredResolve, FrameAllocator>, max_shared_surface_size: i32, memory: &FrameMemory, ) -> RenderTaskGraph
End the graph building phase and produce the immutable task graph for this frame
Auto Trait Implementations§
impl Freeze for RenderTaskGraphBuilder
impl RefUnwindSafe for RenderTaskGraphBuilder
impl Send for RenderTaskGraphBuilder
impl Sync for RenderTaskGraphBuilder
impl Unpin for RenderTaskGraphBuilder
impl UnwindSafe for RenderTaskGraphBuilder
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
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more