pub struct WgpuRenderer { /* private fields */ }Expand description
自研轻量级 wgpu 2D SDF 渲染管线核心(绑定任意目标 TextureView 即可渲染)。
Implementations§
Source§impl WgpuRenderer
impl WgpuRenderer
Sourcepub fn new(device: &Device, target_format: TextureFormat) -> Self
pub fn new(device: &Device, target_format: TextureFormat) -> Self
基于已有 wgpu::Device 与目标表面像素格式创建 2D SDF 渲染管线。
Sourcepub fn last_primitive_count(&self) -> usize
pub fn last_primitive_count(&self) -> usize
返回最近一帧合批提交的 GpuPrimitive 实例数量。
Sourcepub const fn atlas_sizes(&self) -> (u32, u32)
pub const fn atlas_sizes(&self) -> (u32, u32)
返回当前字形图集与精灵图集的物理像素边长 (glyph_size, sprite_size)。
Sourcepub const fn sprite_cache_hits(&self) -> u64
pub const fn sprite_cache_hits(&self) -> u64
返回静态精灵跨帧驻留缓存累计命中次数。
Sourcepub const fn text_layout_cache_hits(&self) -> u64
pub const fn text_layout_cache_hits(&self) -> u64
返回跨帧文本行排版缓存(TextLayoutCache)累计命中次数。
Sourcepub fn text_layout_cache_len(&self) -> usize
pub fn text_layout_cache_len(&self) -> usize
返回跨帧文本行排版缓存当前驻留条目数。
Auto Trait Implementations§
impl !RefUnwindSafe for WgpuRenderer
impl !UnwindSafe for WgpuRenderer
impl Forget for WgpuRenderer
impl Freeze for WgpuRenderer
impl Move for WgpuRenderer
impl Send for WgpuRenderer
impl Sync for WgpuRenderer
impl Unpin for WgpuRenderer
impl UnsafeUnpin for WgpuRenderer
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> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
当
condition 为 true 时执行闭包修饰自身,否则原样返回。Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Self
fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
根据
condition 在两个修饰分支之间二选一。Source§fn when_some<O>(
self,
option: Option<O>,
then: impl FnOnce(Self, O) -> Self,
) -> Self
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。