#[repr(C)]pub struct GridStaticMeta {Show 23 fields
pub occupancy_offset: u32,
pub color_offsets_offset: u32,
pub colors_offset: u32,
pub chunk_colors_base_offset: u32,
pub chunk_occupancy_offset: u32,
pub slot_chunk_idx_offset: u32,
pub vsid: u32,
pub total_slots: u32,
pub pool_dims: [u32; 3],
pub _pad0: u32,
pub occ_words_per_slot: u32,
pub offsets_words_per_slot: u32,
pub mip_count: u32,
pub _pad1: u32,
pub mip_occ_rel: [u32; 6],
pub mip_coff_rel: [u32; 6],
pub aabb_min: [i32; 3],
pub _pad2: i32,
pub aabb_max: [i32; 3],
pub _pad3: i32,
pub chunk_occ_mip_off: [u32; 4],
pub chunk_occ_levels: u32,
pub _pad4: [u32; 3],
}Expand description
Per-grid static metadata: offsets into the concatenated storage buffers + the grid’s slot-pool dimensions. Uploaded once.
GPU.7 changes: chunks_dims and origin_chunk were dropped.
The shader uses modular slot indexing
(chunk_idx & (pool_dims - 1)) and verifies slot identity via
slot_chunk_idx[slot], so the upload-time bbox is no longer
relevant to the shader.
Fields§
§occupancy_offset: u32occupancy u32-word offset where this grid’s data starts.
color_offsets_offset: u32all_color_offsets (binding 2) u32-word offset where this
grid’s per-slot colour-offset tables start; slot meta_id’s
window is offsets_words_per_slot words from
color_offsets_offset + meta_id * offsets_words_per_slot.
colors_offset: u32all_colors (binding 3) u32-word offset where this grid’s
packed voxel colours start (per-slot blocks of the grid’s
colour stride).
chunk_colors_base_offset: u32all_chunk_colors_base (binding 4) u32-word offset of this
grid’s per-slot table mapping meta_id → the slot’s colour
base (in words, relative to colors_offset).
chunk_occupancy_offset: u32all_chunk_occupancy (binding 5) u32-word offset of this
grid’s chunk-occupancy bitmap: bit slot_idx & 31 of word
slot_idx >> 5 is set iff the slot holds a non-empty chunk —
the outer DDA’s whole-chunk skip test.
slot_chunk_idx_offset: u32New in GPU.7: u32-word offset where this grid’s
slot_chunk_idx array starts (one vec3<i32> per slot,
i.e. 3 u32 words each, plus 1 padding word for std430).
vsid: u32Chunk XY extent in voxels (typically 128); the chunk’s Z extent
is the fixed CHUNK_Z = 256.
total_slots: u32Slot count in the modular pool
(pool_dims.x · pool_dims.y · pool_dims.z).
pool_dims: [u32; 3]GPU.7 slot-pool dimensions (each a power of 2). Chunk
(chx, chy, chz) lives in slot
(chx & (pool_dims.x - 1), chy & …, chz & …).
_pad0: u32std430 padding; always 0.
occ_words_per_slot: u32GPU.11 — per-slot occupancy stride (sum over all mips).
meta_id’s occupancy slab starts at
occupancy_offset + meta_id * occ_words_per_slot.
offsets_words_per_slot: u32GPU.11 — per-slot color_offsets stride (sum over all mips).
mip_count: u32GPU.11 — number of mip levels stored per slot.
_pad1: u32std430 padding; always 0.
mip_occ_rel: [u32; 6]GPU.11 — within-slot u32 offset where mip m’s occupancy
starts. mip_occ_rel[0] == 0 so mip-0 reads are unchanged.
mip_coff_rel: [u32; 6]GPU.11 — within-slot u32 offset where mip m’s color_offsets
start. mip_coff_rel[0] == 0.
aabb_min: [i32; 3]GPU.13.0 — occupied chunk-AABB (inclusive) in chunk-index space.
The outer DDA stops once p_chunk passes this box along the
ray’s travel direction (no resident chunk can lie ahead). An
empty grid uses the inverted sentinel (aabb_min = i32::MAX,
aabb_max = i32::MIN) so every ray early-outs immediately.
Maintained live: GpuSceneResident::refresh_chunk /
GpuSceneResident::evict_chunk recompute + re-upload it.
_pad2: i32std430 vec3<i32> padding; always 0.
aabb_max: [i32; 3]Inclusive upper corner of the occupied chunk-AABB (chunk-index
space); i32::MIN sentinel when the grid holds no chunks. See
Self::aabb_min.
_pad3: i32std430 vec3<i32> padding; always 0.
chunk_occ_mip_off: [u32; 4]GPU.13.1 — all_chunk_occupancy u32-word offsets of this
grid’s chunk-occupancy pyramid levels 1..=4 (entry l - 1 =
level l; entries past Self::chunk_occ_levels are 0).
Level l has max(pool_dims >> l, 1) cells per axis; a set
bit means “some resident non-empty chunk maps into this
slot-block” — the outer DDA’s read-free empty-block skip.
chunk_occ_levels: u32GPU.13.1 — pyramid levels stored above L0 (0 = no pyramid, the single-chunk-pool degenerate case).
_pad4: [u32; 3]std430 padding; always 0.
Trait Implementations§
Source§impl Clone for GridStaticMeta
impl Clone for GridStaticMeta
Source§fn clone(&self) -> GridStaticMeta
fn clone(&self) -> GridStaticMeta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for GridStaticMeta
Source§impl Debug for GridStaticMeta
impl Debug for GridStaticMeta
impl Pod for GridStaticMeta
Auto Trait Implementations§
impl Freeze for GridStaticMeta
impl RefUnwindSafe for GridStaticMeta
impl Send for GridStaticMeta
impl Sync for GridStaticMeta
impl Unpin for GridStaticMeta
impl UnsafeUnpin for GridStaticMeta
impl UnwindSafe for GridStaticMeta
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§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.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.