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 moreAuto Trait Implementations§
impl Freeze for ChunkUpload
impl RefUnwindSafe for ChunkUpload
impl Send for ChunkUpload
impl Sync for ChunkUpload
impl Unpin for ChunkUpload
impl UnsafeUnpin for ChunkUpload
impl UnwindSafe for ChunkUpload
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.