pub struct BackdropTable {
pub bind_groups: HashMap<u16, BindGroup>,
/* private fields */
}Expand description
Blurred backdrop textures keyed by isolated pass id (keeps pool leases alive).
Bind groups and leases are retained together until compositing finishes, so pooled textures cannot be reused while sampled by the frame.
§Examples
use ailloli_ui_render_wgpu::BackdropTable;
let table = BackdropTable::empty();
assert!(table.bind_groups.is_empty());Fields§
§bind_groups: HashMap<u16, BindGroup>Sample bindings indexed by the frame-local u16 pass identifier.
Implementations§
Source§impl BackdropTable
impl BackdropTable
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Creates a table with no bindings or live pool leases.
§Examples
use ailloli_ui_render_wgpu::BackdropTable;
assert!(BackdropTable::empty().get(0).is_none());Sourcepub fn get(&self, pass_id: u16) -> Option<&BindGroup>
pub fn get(&self, pass_id: u16) -> Option<&BindGroup>
Returns the backdrop sample binding for pass_id.
§Examples
use ailloli_ui_render_wgpu::BackdropTable;
assert!(BackdropTable::empty().get(7).is_none());Sourcepub fn insert(
&mut self,
pass_id: u16,
lease: LeasedOffscreen,
bind_group: BindGroup,
)
pub fn insert( &mut self, pass_id: u16, lease: LeasedOffscreen, bind_group: BindGroup, )
Inserts or replaces a binding and retains the associated pool lease.
Replacing a binding does not remove the earlier lease; both remain live until the table is dropped, preventing premature pool reuse.
§Examples
use ailloli_ui_render_wgpu::{BackdropTable, offscreen_pool::LeasedOffscreen};
fn retain(table: &mut BackdropTable, lease: LeasedOffscreen, binding: wgpu::BindGroup) {
table.insert(1, lease, binding);
}Trait Implementations§
Source§impl Default for BackdropTable
impl Default for BackdropTable
Source§fn default() -> BackdropTable
fn default() -> BackdropTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BackdropTable
impl !RefUnwindSafe for BackdropTable
impl Send for BackdropTable
impl Sync for BackdropTable
impl Unpin for BackdropTable
impl !UnwindSafe for BackdropTable
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().