pub struct RendererConfig {
pub text_cache_capacity: NonZeroUsize,
pub svg_cache_capacity: NonZeroUsize,
pub svg_trees_capacity: NonZeroUsize,
pub shared_elements_capacity: NonZeroUsize,
pub image_uv_capacity: NonZeroUsize,
pub texture_registry_capacity: NonZeroUsize,
pub mega_heim_width: u32,
pub mega_heim_height: u32,
}Expand description
Configurable parameters for the GpuRenderer.
The 5220-line GpuRenderer monolith hardcoded six LRU cache
sizes plus the Mega-Heim atlas dimensions. This struct
extracts those tunables so they can be adjusted at runtime via
GpuRenderer::set_config() (e.g., to use a low_vram preset
after detecting a device with limited VRAM).
Fields§
§text_cache_capacity: NonZeroUsizeCapacity of the text glyph cache (keyed by glyph hash).
svg_cache_capacity: NonZeroUsizeCapacity of the SVG tessellated model cache.
svg_trees_capacity: NonZeroUsizeCapacity of the parsed usvg::Tree cache.
Capacity of the shared element (Lottie) cache.
image_uv_capacity: NonZeroUsizeCapacity of the image UV registry.
texture_registry_capacity: NonZeroUsizeCapacity of the texture name -> handle registry.
mega_heim_width: u32Width of the Mega-Heim shared texture atlas.
mega_heim_height: u32Height of the Mega-Heim shared texture atlas.
Implementations§
Source§impl RendererConfig
impl RendererConfig
Sourcepub fn mega_heim_vram_bytes(&self) -> u64
pub fn mega_heim_vram_bytes(&self) -> u64
Total VRAM cost of the Mega-Heim texture in bytes (RGBA8 = 4 bytes/pixel).
Trait Implementations§
Source§impl Clone for RendererConfig
impl Clone for RendererConfig
Source§fn clone(&self) -> RendererConfig
fn clone(&self) -> RendererConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RendererConfig
impl Debug for RendererConfig
Auto Trait Implementations§
impl Freeze for RendererConfig
impl RefUnwindSafe for RendererConfig
impl Send for RendererConfig
impl Sync for RendererConfig
impl Unpin for RendererConfig
impl UnsafeUnpin for RendererConfig
impl UnwindSafe for RendererConfig
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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>
ReadEndian::read_from_little_endian().