pub struct GfxInstance {
pub pos: [f32; 2],
pub size: [f32; 2],
pub uv_rect: [f32; 4],
pub color: [f32; 4],
pub color_end: [f32; 4],
pub gradient: [f32; 4],
pub params: [f32; 4],
}Expand description
GPU 实例数据。字段顺序和大小必须与 d3d11::Instance(backend 实现)一致。
第 2 步的 impl RenderBackend for D3dBackend 必须做转换 + 布局校验。
字段顺序/类型与 y901-backend-win32::backend::d3d11::Instance 保持一致,
但本模块不依赖那个类型——后端负责在自己的实现里做转换或复用同一布局。
Fields§
§pos: [f32; 2]左上角像素坐标。
size: [f32; 2]像素尺寸。
uv_rect: [f32; 4]图集 UV 矩形 [u0, v0, u1, v1]。
color: [f32; 4]RGBA(0..1)。
color_end: [f32; 4]渐变终点色(纯色时等于 color)。
gradient: [f32; 4](dir.x, dir.y, mode, offset);mode=1 表示线性渐变。
params: [f32; 4](radius, softness, 0, 0);radius>0 时走 GPU SDF 圆角。
Trait Implementations§
Source§impl Clone for GfxInstance
impl Clone for GfxInstance
impl Copy for GfxInstance
Source§impl Debug for GfxInstance
impl Debug for GfxInstance
Source§impl PartialEq for GfxInstance
impl PartialEq for GfxInstance
impl StructuralPartialEq for GfxInstance
Auto Trait Implementations§
impl Forget for GfxInstance
impl Freeze for GfxInstance
impl Move for GfxInstance
impl RefUnwindSafe for GfxInstance
impl Send for GfxInstance
impl Sync for GfxInstance
impl Unpin for GfxInstance
impl UnsafeUnpin for GfxInstance
impl UnwindSafe for GfxInstance
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