pub enum TextureUpdate {
Reuse,
UpdateContent,
Recreate,
}Expand description
一张图片纹理在“同一个 texture_id 又来了一次 register“时该怎么处理。
GPU 与软件后端必须走同一个判断(ROADMAP_0.4.md §2.2 V-P0-1 的修复契约):
以前 GPU 端同 id 直接 return(新帧永远传不上去),软件端却按 Rc 身份重建缓存,
两个后端语义不一致 —— 把这段判断收进一个纯函数,不一致就没有藏身之处了。
Variants§
Reuse
同一份源数据、同一尺寸:纹理原样复用,什么都不做。
UpdateContent
新帧、尺寸不变:只覆盖纹理内容(不重建纹理、不换 view)。
Recreate
尺寸变了(或首次出现):重建纹理。
Trait Implementations§
Source§impl Clone for TextureUpdate
impl Clone for TextureUpdate
impl Copy for TextureUpdate
Source§impl Debug for TextureUpdate
impl Debug for TextureUpdate
impl Eq for TextureUpdate
Source§impl PartialEq for TextureUpdate
impl PartialEq for TextureUpdate
impl StructuralPartialEq for TextureUpdate
Auto Trait Implementations§
impl Forget for TextureUpdate
impl Freeze for TextureUpdate
impl Move for TextureUpdate
impl RefUnwindSafe for TextureUpdate
impl Send for TextureUpdate
impl Sync for TextureUpdate
impl Unpin for TextureUpdate
impl UnsafeUnpin for TextureUpdate
impl UnwindSafe for TextureUpdate
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