pub struct SharedFrameLease {
pub generation_id: u32,
pub slot_index: u8,
pub width: u32,
pub height: u32,
pub format: TextureFormat,
pub handle: ExportedHandle,
pub sync_handle: ExternalSyncHandle,
pub fence_value: u64,
pub dirty_rects: SmallVec<Region, 8>,
pub is_fresh: bool,
}Expand description
宿主调用 WgpuSharedExportRenderer::acquire_shared_frame 获得的只读共享帧租约。
Fields§
§generation_id: u32表面重建代数(窗口 Resize 后递增,宿主据以检测并重新导入共享句柄)。
slot_index: u8当前锁定的三缓冲槽位索引(0..3)。
width: u32物理像素宽度。
height: u32物理像素高度。
format: TextureFormat像素格式(默认 Bgra8Unorm 或 Rgba8Unorm,预乘 Alpha)。
handle: ExportedHandle跨 API 显存导出句柄(Win32 NT HANDLE / Linux dma_buf fd / Apple IOSurface / Android AHB)。
sync_handle: ExternalSyncHandle跨 API GPU 同步栅栏/信号量句柄。
fence_value: u64宿主采样前需等待的 GPU 栅栏单调计数值。
dirty_rects: SmallVec<Region, 8>合并最近 3 帧后的有效脏矩形列表(供宿主做局部合成优化)。
is_fresh: bool本次获取是否为新提交帧(false 表示复用了上次最新帧)。
Trait Implementations§
Auto Trait Implementations§
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> 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) 时执行闭包修饰自身,否则原样返回。