Skip to main content

VeloxSharedFrameDesc

Struct VeloxSharedFrameDesc 

Source
#[repr(C)]
pub struct VeloxSharedFrameDesc {
Show 18 fields pub generation_id: u32, pub slot_index: u8, pub is_fresh: u8, pub handle_kind: u8, pub sync_kind: u8, pub width: u32, pub height: u32, pub pixel_format: u32, pub raw_handle: u64, pub sync_handle: u64, pub fence_value: u64, pub stride: u32, pub offset: u32, pub drm_format: u32, pub drm_modifier: u64, pub software_rgba_ptr: *const u8, pub dirty_rects_ptr: *const CDirtyRect, pub dirty_rect_count: u32,
}
Expand description

跨语言零拷贝共享帧描述符(由宿主通过 velox_embed_acquire_shared_frame 获取)。

Fields§

§generation_id: u32

表面重建代数(窗口 Resize 后递增,宿主检测到变化须重新打开共享句柄)。

§slot_index: u8

三缓冲槽位索引(0..3)。

§is_fresh: u8

1 表示本帧为新渲染完成的画面,0 表示复用上次最新帧。

§handle_kind: u8

显存句柄类型(见 VeloxHandleKind)。

§sync_kind: u8

同步原语类型(见 VeloxSyncKind)。

§width: u32

物理像素宽度。

§height: u32

物理像素高度。

§pixel_format: u32

像素格式编码(0 = Rgba8Unorm,1 = Bgra8Unorm,均为预乘 Alpha)。

§raw_handle: u64

跨 API 原始显存句柄(Win32 NT HANDLE / Linux dma_buf fd / IOSurfaceRef / AHB*)。

§sync_handle: u64

跨 API GPU 同步句柄(ID3D12Fence NT HANDLE / Timeline Semaphore fd / MTLSharedEvent)。

§fence_value: u64

宿主采样前需等待的 GPU 栅栏单调计数值。

§stride: u32

行步长(字节,主要用于 LinuxDmaBufFd 与 SoftwareRgbaPtr)。

§offset: u32

平面字节偏移量。

§drm_format: u32

DRM FourCC(仅 Linux DMA-BUF 有效)。

§drm_modifier: u64

DRM Format Modifier(仅 Linux DMA-BUF 有效)。

§software_rgba_ptr: *const u8

软件光栅回退模式的 RGBA8888 像素缓冲指针(GPU 模式下为空指针)。

§dirty_rects_ptr: *const CDirtyRect

脏矩形数组指针(三缓冲 GPU 模式下已自动做 3 帧并集合并)。

§dirty_rect_count: u32

脏矩形数量。

Trait Implementations§

Source§

impl Clone for VeloxSharedFrameDesc

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for VeloxSharedFrameDesc

Source§

impl Debug for VeloxSharedFrameDesc

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for VeloxSharedFrameDesc

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> FluentBuilder for T

Source§

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

根据 condition 在两个修饰分支之间二选一。
Source§

fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self

当 option 为 Some(value) 时执行闭包修饰自身,否则原样返回。
Source§

fn when_none<O>( self, option: &Option<O>, then: impl FnOnce(Self) -> Self, ) -> Self

当 option 为 None 时执行闭包修饰自身,否则原样返回。
Source§

fn apply<U>(self, f: impl FnOnce(Self) -> U) -> U

通用管道映射变换(避免与 Iterator::map / Option::map 重名)。
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.