pub struct AtlasSnapshot {
pub width: u32,
pub height: u32,
pub dirty: bool,
pub dirty_y: (u32, u32),
pub pixels: Option<Vec<u8>>,
}Expand description
Atlas 当前状态快照
Renderer 拿到 snapshot 后决定:
- size 变化 → 重建 GPU texture
- dirty 变化 →
write_texture上传dirty_y行区间(pixels已按 整行宽度打包,行宽 = atlas 宽度 → 满足 256 字节对齐) - 否则 → 复用 cache 的 view/sampler
Fields§
§width: u32§height: u32§dirty: bool§dirty_y: (u32, u32)本次 dirty 的行区间 [top, bottom)(整行宽度);其余行 GPU 侧保持原值。
dirty=false 时为 (0, 0)。
pixels: Option<Vec<u8>>像素数据:dirty_y 区间内的整行(长度 = width × 行数),不 dirty 时 None
Trait Implementations§
Source§impl Clone for AtlasSnapshot
impl Clone for AtlasSnapshot
Source§fn clone(&self) -> AtlasSnapshot
fn clone(&self) -> AtlasSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Forget for AtlasSnapshot
impl Freeze for AtlasSnapshot
impl Move for AtlasSnapshot
impl RefUnwindSafe for AtlasSnapshot
impl Send for AtlasSnapshotwhere
RawVecInner: Send,
impl Sync for AtlasSnapshotwhere
RawVecInner: Sync,
impl Unpin for AtlasSnapshot
impl UnsafeUnpin for AtlasSnapshot
impl UnwindSafe for AtlasSnapshotwhere
RawVecInner: UnwindSafe,
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