struct Surface {
kind: RenderTargetKind,
allocator: GuillotineAllocator,
is_shared: bool,
lifetime_group: PassId,
pending_frees: usize,
}Expand description
An internal representation of a dynamic surface that tasks can be allocated into. Maintains some extra metadata about each surface during the graph build.
Fields§
§kind: RenderTargetKindWhether this is a color or alpha render target
allocator: GuillotineAllocatorAllocator for this surface texture
We can only allocate into this for reuse if it’s a shared surface
lifetime_group: PassIdThe lifetime group of this surface: only tasks with a matching lifetime_group can share it, to avoid holding the surface longer than necessary.
pending_frees: usizeReference count: number of tasks whose individual free_after will trigger a decrement. Surface is returned to the pool when this reaches 0.
Implementations§
Source§impl Surface
impl Surface
Sourcefn alloc_rect(
&mut self,
size: DeviceIntSize,
kind: RenderTargetKind,
is_shared: bool,
lifetime_group: PassId,
) -> Option<DeviceIntPoint>
fn alloc_rect( &mut self, size: DeviceIntSize, kind: RenderTargetKind, is_shared: bool, lifetime_group: PassId, ) -> Option<DeviceIntPoint>
Allocate a rect within a shared surfce. Returns None if the format doesn’t match, or allocation fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Surface
impl RefUnwindSafe for Surface
impl Send for Surface
impl Sync for Surface
impl Unpin for Surface
impl UnsafeUnpin for Surface
impl UnwindSafe for Surface
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