#[repr(C)]pub struct ChunkGpu {
pub frame_a: [f32; 4],
pub frame_b: [f32; 4],
pub frame_c: [f32; 4],
pub bary0: [f32; 2],
pub bary1: [f32; 2],
pub bary2: [f32; 2],
pub slot: u32,
pub level: u32,
pub res: u32,
pub _pad: [u32; 3],
}Expand description
One chunk’s GPU descriptor (std430, 96 bytes).
Field order is the shader’s layout contract — do not reorder without updating
ChunkRealize.slang. Every array member is [f32;4] or smaller, and the struct
is padded to a 16-byte multiple so that an array of ChunkGpu has the correct
std430 stride (the shader indexes chunks[i] directly).
Fields§
§frame_a: [f32; 4]Face frame corner A (xyz) and sphere radius (w); radius=0 → flat terrain.
frame_b: [f32; 4]Face frame corner B (xyz), w=0 (unused).
frame_c: [f32; 4]Face frame corner C (xyz), w=0 (unused).
bary0: [f32; 2]Barycentric coords of chunk corner 0: (wb, wc); wa = 1 − wb − wc.
bary1: [f32; 2]Barycentric coords of chunk corner 1.
bary2: [f32; 2]Barycentric coords of chunk corner 2.
slot: u32Vertex-pool slot: this chunk owns verts_per_chunk(res) contiguous vertices
starting at slot * verts_per_chunk(res) in the pool texture.
level: u32LOD level (== quadtree depth from the icosphere face root).
res: u32Edge resolution: each chunk edge has res segments; vertex count = verts_per_chunk(res).
_pad: [u32; 3]Explicit std430 padding: rounds the struct from 84 → 96 bytes so that
size_of::<ChunkGpu>() % 16 == 0 (required by the std430 array-stride rule).
Implementations§
Trait Implementations§
impl Copy for ChunkGpu
impl Pod for ChunkGpu
impl StructuralPartialEq for ChunkGpu
Auto Trait Implementations§
impl Freeze for ChunkGpu
impl RefUnwindSafe for ChunkGpu
impl Send for ChunkGpu
impl Sync for ChunkGpu
impl Unpin for ChunkGpu
impl UnsafeUnpin for ChunkGpu
impl UnwindSafe for ChunkGpu
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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.