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>
impl<D: Device> GpuBrickAtlas<D>
Sourcepub fn new(
device: &D,
queue: &D::Queue,
catalog: &BrickCatalog,
config: BrickAtlasConfig,
) -> Result<Self, BrickAtlasError>
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.
Sourcepub fn begin_frame(&mut self)
pub fn begin_frame(&mut self)
Resets only the bounded per-frame upload allowance.
Sourcepub fn stage(
&mut self,
device: &D,
queue: &D::Queue,
upload: BrickAtlasUpload<'_>,
) -> Result<FenceValue, BrickAtlasError>
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.
Sourcepub fn request_eviction(
&mut self,
device: &D,
queue: &D::Queue,
brick: BrickId,
) -> Result<FenceValue, BrickAtlasError>
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.
Sourcepub fn poll(
&mut self,
device: &D,
queue: &D::Queue,
) -> Result<BrickAtlasPoll, BrickAtlasError>
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.
Sourcepub fn resolve(&self, address: BrickAddress) -> Option<u32>
pub fn resolve(&self, address: BrickAddress) -> Option<u32>
Resolves an exact global logical address to an atlas-local slot.
Sourcepub const fn view(&self) -> &D::TextureView
pub const fn view(&self) -> &D::TextureView
Physical atlas view used by scalar, segmentation and field shaders.
Sourcepub const fn page_buffer(&self) -> &D::Buffer
pub const fn page_buffer(&self) -> &D::Buffer
Persistent generational hash table consumed by sparse shader lookup.
Sourcepub const fn stored_shape(&self) -> [u16; 3]
pub const fn stored_shape(&self) -> [u16; 3]
Common physical shape, including halo voxels.
Sourcepub const fn metrics(&self) -> BrickAtlasMetrics
pub const fn metrics(&self) -> BrickAtlasMetrics
Current bounded memory and lifecycle counters.
Trait Implementations§
Auto Trait Implementations§
impl<D> Freeze for GpuBrickAtlas<D>
impl<D> RefUnwindSafe for GpuBrickAtlas<D>where
<D as Device>::Texture: RefUnwindSafe,
<D as Device>::TextureView: RefUnwindSafe,
<D as Device>::Buffer: RefUnwindSafe,
impl<D> Send for GpuBrickAtlas<D>
impl<D> Sync for GpuBrickAtlas<D>
impl<D> Unpin for GpuBrickAtlas<D>
impl<D> UnsafeUnpin for GpuBrickAtlas<D>where
<D as Device>::Texture: UnsafeUnpin,
<D as Device>::TextureView: UnsafeUnpin,
<D as Device>::Buffer: UnsafeUnpin,
impl<D> UnwindSafe for GpuBrickAtlas<D>where
<D as Device>::Texture: UnwindSafe,
<D as Device>::TextureView: UnwindSafe,
<D as Device>::Buffer: UnwindSafe,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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