Skip to main content

RenderBufferPool

Struct RenderBufferPool 

Source
pub struct RenderBufferPool { /* private fields */ }
Expand description

Zero-allocation bounded CPU RGBA8 render output buffer pool with fence-gated reclamation.

Implementations§

Source§

impl RenderBufferPool

Bounded zero-allocation buffer pooling and fence-gated release for RenderBufferPool.

Source

pub fn with_capacity(slot_count: usize) -> Self

Creates a bounded RenderBufferPool holding slot_count reusable slots (clamped to 1..=8).

§Arguments
  • usize - Requested bounded slot count.
§Returns
  • Self - Initialized render buffer pool.
Source

pub fn preallocate(&self, width: u32, height: u32)

Pre-allocates backing storage for all slots for a (width, height) RGBA8 framebuffer so steady-state renders allocate zero bytes.

§Arguments
  • &Self - Pool reference.
  • u32 - Framebuffer width in pixels.
  • u32 - Framebuffer height in pixels.
Source

pub fn acquire( &self, width: u32, height: u32, fence_id: u64, ) -> Option<PooledFrameLease>

Acquires a free buffer slot sized for (width, height) RGBA8 output tagged with fence_id.

Returns None when all bounded slots are still in flight (enforcing strict memory backpressure).

§Arguments
  • &Self - Pool reference.
  • u32 - Target framebuffer width in pixels.
  • u32 - Target framebuffer height in pixels.
  • u64 - Fence value guarding reclamation of this frame.
§Returns
  • Option<PooledFrameLease> - Exclusive RAII buffer lease, or None under backpressure.
Source

pub fn retire_fence(&self, completed_fence: u64) -> usize

Retires all in-flight slots whose fence_id <= completed_fence, making them available for zero-allocation reuse.

§Arguments
  • &Self - Pool reference.
  • u64 - Highest fence confirmed complete by the compositor or uploader.
§Returns
  • usize - Number of slots retired back to the free set.
Source

pub fn stats(&self) -> RenderBufferPoolStats

Returns a snapshot of current pool capacity, in-flight slots, reuse hits, and backpressure rejections.

§Arguments
  • &Self - Pool reference.
§Returns
  • RenderBufferPoolStats - Current pool telemetry snapshot.

Trait Implementations§

Source§

impl Clone for RenderBufferPool

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RenderBufferPool

Source§

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

Formats the struct fields as a debug struct, skipping excluded fields.

§Arguments
  • &mut ::std::fmt::Formatter<'_> - The formatter to write the representation into.
§Returns
  • ::std::fmt::Result - Success or failure of the formatting operation.
Source§

impl Default for RenderBufferPool

Default triple-buffered RenderBufferPool.

Source§

fn default() -> Self

Creates a bounded triple-buffered CPU render output pool (3 slots).

§Returns
  • Self - Default render buffer pool.

Auto Trait Implementations§

§

impl !RefUnwindSafe for RenderBufferPool

§

impl !Send for RenderBufferPool

§

impl !Sync for RenderBufferPool

§

impl !UnwindSafe for RenderBufferPool

§

impl Forget for RenderBufferPool

§

impl Freeze for RenderBufferPool
where *const RcInner<RefCell<RenderBufferPoolState>> is !null: Freeze, PhantomData<RcInner<RefCell<RenderBufferPoolState>>>: Freeze,

§

impl Move for RenderBufferPool

§

impl Unpin for RenderBufferPool
where Rc<RefCell<RenderBufferPoolState>>: Unpin,

§

impl UnsafeUnpin for RenderBufferPool
where *const RcInner<RefCell<RenderBufferPoolState>> is !null: UnsafeUnpin, PhantomData<RcInner<RefCell<RenderBufferPoolState>>>: UnsafeUnpin,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.