pub struct VirtualTexture {
pub page_table: Vec<Vec<u32>>,
pub tile_cache: HashMap<u64, VirtualTextureTile>,
pub atlas_size: u32,
pub tile_size: u32,
pub num_mips: u32,
pub max_resident_tiles: usize,
pub resident_count: usize,
pub free_slots: VecDeque<u32>,
pub feedback_buffer: Vec<u32>,
pub current_frame: u64,
}Fields§
§page_table: Vec<Vec<u32>>§tile_cache: HashMap<u64, VirtualTextureTile>§atlas_size: u32§tile_size: u32§num_mips: u32§max_resident_tiles: usize§resident_count: usize§free_slots: VecDeque<u32>§feedback_buffer: Vec<u32>§current_frame: u64Implementations§
Source§impl VirtualTexture
impl VirtualTexture
pub fn new(atlas_size: u32, tile_size: u32, num_mips: u32) -> Self
pub fn request_tile(&mut self, mip: u32, tile_x: u32, tile_y: u32, frame: u64)
pub fn load_tile(&mut self, mip: u32, tile_x: u32, tile_y: u32) -> Option<u32>
pub fn evict_tile(&mut self, mip: u32, tile_x: u32, tile_y: u32)
pub fn analyze_feedback_buffer(&self) -> Vec<(u32, u32, u32, f32)>
pub fn record_feedback(&mut self, mip: u32)
pub fn clear_feedback(&mut self)
pub fn tile_atlas_uv(&self, slot: u32) -> (Vec2, Vec2)
pub fn evict_lru_tiles(&mut self, target_free: usize)
Trait Implementations§
Source§impl Clone for VirtualTexture
impl Clone for VirtualTexture
Auto Trait Implementations§
impl Freeze for VirtualTexture
impl RefUnwindSafe for VirtualTexture
impl Send for VirtualTexture
impl Sync for VirtualTexture
impl Unpin for VirtualTexture
impl UnsafeUnpin for VirtualTexture
impl UnwindSafe for VirtualTexture
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.