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: FrameId
Current 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>,
max_shared_surface_size: i32,
) -> RenderTaskGraph
pub fn end_frame( &mut self, resource_cache: &mut ResourceCache, gpu_cache: &mut GpuCache, deferred_resolves: &mut Vec<DeferredResolve>, max_shared_surface_size: i32, ) -> 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