Skip to main content

GpuBrickAtlas

Struct GpuBrickAtlas 

Source
pub struct GpuBrickAtlas<D: Device> { /* private fields */ }
Expand description

Fixed-capacity physical atlas and generational sparse page table.

Implementations§

Source§

impl<D: Device> GpuBrickAtlas<D>

Source

pub fn new( device: &D, queue: &D::Queue, catalog: &BrickCatalog, config: BrickAtlasConfig, ) -> Result<Self, BrickAtlasError>

Allocates the complete atlas, page table and staging storage once.

§Errors

Rejects zero, overflowing or device-incompatible capacities.

Source

pub fn begin_frame(&mut self)

Resets only the bounded per-frame upload allowance.

Source

pub fn stage( &mut self, device: &D, queue: &D::Queue, upload: BrickAtlasUpload<'_>, ) -> Result<FenceValue, BrickAtlasError>

Stages one brick and submits an ordered fence for its publication.

The provider allocation is borrowed only for this call. Its bytes are copied once into the persistent upload ring and never into scene state.

§Errors

Returns typed shape, semantic, lifecycle or upload backpressure.

Source

pub fn request_eviction( &mut self, device: &D, queue: &D::Queue, brick: BrickId, ) -> Result<FenceValue, BrickAtlasError>

Invalidates a mapping and releases its slot only after an ordered fence.

§Errors

Returns a typed absent-page, duplicate-eviction or capacity error.

Source

pub fn poll( &mut self, device: &D, queue: &D::Queue, ) -> Result<BrickAtlasPoll, BrickAtlasError>

Publishes current generations and releases fence-safe evictions.

§Errors

Device loss or an inconsistent working-set transition is returned.

Source

pub fn resolve(&self, address: BrickAddress) -> Option<u32>

Resolves an exact global logical address to an atlas-local slot.

Source

pub const fn view(&self) -> &D::TextureView

Physical atlas view used by scalar, segmentation and field shaders.

Source

pub const fn page_buffer(&self) -> &D::Buffer

Persistent generational hash table consumed by sparse shader lookup.

Source

pub const fn page_mask(&self) -> u32

Hash mask supplied to sparse lookup uniforms.

Source

pub const fn stored_shape(&self) -> [u16; 3]

Common physical shape, including halo voxels.

Source

pub const fn metrics(&self) -> BrickAtlasMetrics

Current bounded memory and lifecycle counters.

Trait Implementations§

Source§

impl<D: Debug + Device> Debug for GpuBrickAtlas<D>
where D::Texture: Debug, D::TextureView: Debug, D::Buffer: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<D> Freeze for GpuBrickAtlas<D>
where <D as Device>::Texture: Freeze, <D as Device>::TextureView: Freeze, <D as Device>::Buffer: Freeze,

§

impl<D> RefUnwindSafe for GpuBrickAtlas<D>

§

impl<D> Send for GpuBrickAtlas<D>
where <D as Device>::Texture: Send, <D as Device>::TextureView: Send, <D as Device>::Buffer: Send,

§

impl<D> Sync for GpuBrickAtlas<D>
where <D as Device>::Texture: Sync, <D as Device>::TextureView: Sync, <D as Device>::Buffer: Sync,

§

impl<D> Unpin for GpuBrickAtlas<D>
where <D as Device>::Texture: Unpin, <D as Device>::TextureView: Unpin, <D as Device>::Buffer: Unpin,

§

impl<D> UnsafeUnpin for GpuBrickAtlas<D>

§

impl<D> UnwindSafe for GpuBrickAtlas<D>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.