pub struct GpuGridResident {
pub vsid: u32,
pub origin_chunk: [i32; 3],
pub chunks_dims: [u32; 3],
pub total_chunks: u32,
pub occupancy: Buffer,
pub color_offsets: Buffer,
pub colors: Buffer,
pub chunk_colors_base: Buffer,
pub chunk_occupancy: Buffer,
pub occupancy_bytes: u64,
pub color_offsets_bytes: u64,
pub colors_bytes: u64,
}Expand description
GPU-resident storage for one grid’s chunks. Lives until the host drops it; in GPU.6 (edit invalidation) we’ll re-upload individual chunks via partial buffer writes.
Fields§
§vsid: u32§origin_chunk: [i32; 3]§chunks_dims: [u32; 3]§total_chunks: u32§occupancy: Buffer§color_offsets: Buffer§colors: Buffer§chunk_colors_base: Buffer§chunk_occupancy: Buffer§occupancy_bytes: u64§color_offsets_bytes: u64§colors_bytes: u64Implementations§
Source§impl GpuGridResident
impl GpuGridResident
Sourcepub fn upload(device: &Device, info: &GridUpload) -> Self
pub fn upload(device: &Device, info: &GridUpload) -> Self
Pack + upload info. All buffers are sized to fit
total_chunks regardless of which chunks are actually
present in info.chunks — missing chunks have their
chunk_occupancy bit clear and their per-chunk slices
zero-filled, which the GPU.4 marcher reads as “no voxels
here, skip”.
§Panics
If a chunk’s vsid doesn’t match info.vsid.
Sourcepub fn resident_bytes(&self) -> u64
pub fn resident_bytes(&self) -> u64
Total resident bytes — sum of all five storage buffers. Used by the demo’s startup print.
Auto Trait Implementations§
impl !Freeze for GpuGridResident
impl !RefUnwindSafe for GpuGridResident
impl !UnwindSafe for GpuGridResident
impl Send for GpuGridResident
impl Sync for GpuGridResident
impl Unpin for GpuGridResident
impl UnsafeUnpin for GpuGridResident
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
Mutably borrows from an owned value. Read more