Theme

alex/beta-minecraft-rust

Minecraft Beta 1.7.3 Rewrite

BRANCH main
main
SNAPSHOT Draw terrain GPU-driven from packed per-section buffers with GPU occlusion culling, add a render distance slider (2-128) with a quad/disk shape, cut chunk bookkeeping at high render distances, and fix a light underflow at y=0
DOWNLOAD
Download file

root / crates / volcanic-mem / src / lib.rs

//! TLSF-based Vulkan 1.4 memory allocator for devices using `VK_EXT_descriptor_heap`.
//!
//! ```ignore
//! let allocator = unsafe { Allocator::new(&instance, physical_device, &device_cmds, device, &AllocatorConfig::default())? };
//! let mut buffer = allocator.create_buffer(&BufferDesc {
//!     size: 1 << 20,
//!     usage: VkBufferUsageFlags2::STORAGE_BUFFER,
//!     location: MemoryLocation::CpuToGpu,
//! })?;
//! buffer.mapped_slice_mut().unwrap().fill(0);
//! let range = buffer.range(); // feed into VkResourceDescriptorInfoEXT
//! allocator.destroy_buffer(buffer);
//! ```

mod allocator;
mod device;
mod error;
mod resource;
mod tlsf;
mod virtual_block;

pub use allocator::{
    Allocation, AllocationDesc, Allocator, AllocatorConfig, HeapBudget, MemoryLocation,
    ResourceKind, Statistics,
};
pub use error::{Error, Result};
pub use resource::{Buffer, BufferDesc, DescriptorHeap, DescriptorHeapKind, Image};
pub use virtual_block::{VirtualAllocation, VirtualBlock};