Skip to main content

ImageBatch2d

Struct ImageBatch2d 

Source
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

Source

pub fn sprite_count(&self) -> usize

Returns retained sprite count.

Source

pub fn sprites(&self) -> &[ImageSprite2d]

Returns the exact retained sprite descriptions.

Source

pub const fn budget(&self) -> ImageBatchBudget

Returns its creation/replacement budget.

Source

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.

Source

pub fn gpu_allocation_bytes(&self) -> usize

Returns actual retained GPU buffer bytes, including reusable spare capacity.

Source

pub fn capacity(&self) -> usize

Returns CPU capacity reusable without growing either retained array.

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,