pub struct ChunkUpload {
pub vsid: u32,
pub occupancy: Vec<u32>,
pub color_offsets: Vec<u32>,
pub colors: Vec<u32>,
pub mips: Vec<MipUpload>,
}Expand description
CPU-decompressed chunk ready to upload to the GPU. Each field maps onto one storage buffer in GPU.3+; for GPU.2 the buffers also serve the read-back validator.
Fields§
§vsid: u32XY extent of the chunk in voxels — typically roxlap-scene’s
CHUNK_SIZE_XY = 128. Same as Vxl::vsid.
occupancy: Vec<u32>1 bit per voxel, packed little-endian within each u32.
bit(x, y, z) = (occupancy[i >> 5] >> (i & 31)) & 1
where i = x + y*vsid + z*vsid*vsid.
color_offsets: Vec<u32>vsid*vsid + 1 entries. Column (x, y)’s colours live at
colors[offsets[x + y*vsid] .. offsets[x + y*vsid + 1]],
in ascending-z order across all solid voxels of that column.
colors: Vec<u32>Packed BGRA u32 per solid voxel (textured + bedrock).
mips: Vec<MipUpload>GPU.11 — the full mip ladder, finest (mip-0) first. mips[0]
is identical to the Self::occupancy / Self::color_offsets
/ Self::colors fields above (which the older single-chunk
and single-grid GPU paths still read directly). The scene
path concatenates every mip per slot; the shader marches the
mip its LOD picker selects. Always at least one entry; count
is gpu_mip_count(vsid).
Implementations§
Trait Implementations§
Source§impl Clone for ChunkUpload
impl Clone for ChunkUpload
Source§fn clone(&self) -> ChunkUpload
fn clone(&self) -> ChunkUpload
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more