pub struct ImageBatch2d { /* private fields */ }Expand description
Renderer-owned atlas sprite batch drawn with at most one instanced draw call.
Sprite positions are local logical pixels and can be placed in any frame viewport without rebuilding or uploading the batch. The exact CPU sprite list is retained for renderer recovery. An empty batch is valid and emits no draw call. One fixed inline entry reuses the exact geometry validation result when ordered destination rectangles and their transform are unchanged; position, size or count updates invalidate it, while UV/tint-only updates preserve it. Restoration starts with no cached proof. This does not skip drawing or upload validation and allocates no cache storage.
Implementations§
Source§impl ImageBatch2d
impl ImageBatch2d
Sourcepub fn sprite_count(&self) -> usize
pub fn sprite_count(&self) -> usize
Returns retained sprite count.
Sourcepub fn sprites(&self) -> &[ImageSprite2d]
pub fn sprites(&self) -> &[ImageSprite2d]
Returns the exact retained sprite descriptions.
Sourcepub const fn budget(&self) -> ImageBatchBudget
pub const fn budget(&self) -> ImageBatchBudget
Returns its creation/replacement budget.
Sourcepub fn recovery_memory_bytes(&self) -> usize
pub fn recovery_memory_bytes(&self) -> usize
Returns retained CPU recovery and reusable conversion-staging bytes. Fixed inline handle/proof metadata is excluded, like Vec headers.
Sourcepub fn gpu_allocation_bytes(&self) -> usize
pub fn gpu_allocation_bytes(&self) -> usize
Returns actual retained GPU buffer bytes, including reusable spare capacity.