pub struct MipUpload {
pub vsid: u32,
pub cz: u32,
pub occ_words_per_col: u32,
pub occupancy: Vec<u32>,
pub solid_occupancy: Vec<u32>,
pub color_offsets: Vec<u32>,
pub colors: Vec<u32>,
}Expand description
GPU.11 — one mip level of a chunk in the GPU upload shape. Mip-N
has (vsid >> mip)² columns spanning z = 0..CHUNK_Z >> mip.
color_offsets are absolute within the chunk’s whole colour
block (cumulative across mips): mip-0’s run [0..n0], mip-1’s
run [n0..n0+n1], etc. So colors of all mips concatenated in
level order index directly via chunk_colors_base + offset + rank — the same formula the shader already uses for mip-0,
independent of which mip is being read.
Fields§
§vsid: u32XY column extent at this mip = vsid >> mip.
cz: u32Z-extent at this mip = CHUNK_Z >> mip.
occ_words_per_col: u32Occupancy words per column at this mip = cz.div_ceil(32).
occupancy: Vec<u32>vsid² * occ_words_per_col packed textured occupancy bits
(one set bit per voxel that has an explicit colour). The shader
rank-counts these for the colour lookup.
solid_occupancy: Vec<u32>Same shape as occupancy, but one set bit per solid voxel
— textured surfaces and the implicit bedrock interior below
them. The marcher hit-tests against this so vertical
wall/cliff faces are opaque; bedrock hits inherit the colour of
the textured surface above them. (Fixes the “cliff face shows
sky” bedrock-as-air artifact.)
color_offsets: Vec<u32>vsid² + 1 cumulative-within-chunk colour offsets.
colors: Vec<u32>This mip’s packed BGRA colours (ascending z within a column,
columns in x + y*vsid order).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MipUpload
impl RefUnwindSafe for MipUpload
impl Send for MipUpload
impl Sync for MipUpload
impl Unpin for MipUpload
impl UnsafeUnpin for MipUpload
impl UnwindSafe for MipUpload
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.