Skip to content

ludus::graphics::renderer::RenderGraphAttachmentPool

Ludus Wiki · API overview · Browse API

Class

RG4 exact-descriptor pool for graph-owned transient attachments: allocations backing logical resources that are neither exported nor the presentation surface. A RenderGraph initialized with a pool takes each transient backing from it and returns it on Reset. An idle allocation is reused only when its complete RHI texture description (format, extent, samples, mips, layers, dimension, attachment usage and private depth/stencil aspects) is equal and the RHI submission containing its last frame use has completed; a newer submission's completion covers earlier ones. Exports and surfaces never enter the pool, so no consumer of an export can observe reuse. This is allocation reuse across graph instances (reload, re-initialization), not physical heap aliasing: each live transient still owns its whole allocation. Releasing into a full pool evicts the least recently released idle entry. Not thread-safe: use the RHI owner thread between frames. The device outlives the pool; the pool outlives every graph initialized with it and must be Reset before the device is destroyed.

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/render_graph.hpp

#include <ludus/graphics/renderer/render_graph.hpp>
class ludus::graphics::renderer::RenderGraphAttachmentPool final

Members

internal::RenderGraphPoolAccess

friend struct internal::RenderGraphPoolAccess
Grants RenderGraph acquisition and release of pooled attachments.

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/render_graph.hpp

Methods

RenderGraphAttachmentPool

ludus::graphics::renderer::RenderGraphAttachmentPool::RenderGraphAttachmentPool() noexcept
Construct without a device.

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/render_graph.hpp

~RenderGraphAttachmentPool

ludus::graphics::renderer::RenderGraphAttachmentPool::~RenderGraphAttachmentPool() noexcept
Reset; see Reset.

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/render_graph.hpp

RenderGraphAttachmentPool

ludus::graphics::renderer::RenderGraphAttachmentPool::RenderGraphAttachmentPool(const RenderGraphAttachmentPool &)=delete
Ownership is noncopyable.

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/render_graph.hpp

operator=

RenderGraphAttachmentPool & ludus::graphics::renderer::RenderGraphAttachmentPool::operator=(const RenderGraphAttachmentPool &)=delete
Ownership is nonassignable.

Related types: RenderGraphAttachmentPool

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/render_graph.hpp

Initialize

rhi::RasterStatus ludus::graphics::renderer::RenderGraphAttachmentPool::Initialize(rhi::DeviceHandle device, foundation::uint32 idleCapacity=RENDER_GRAPH_POOL_CAPACITY) noexcept
Bind the pool to a ready device without allocating GPU resources.
ParameterDescription
device
Ready owned device; outlives the pool and every graph initialized with it.
idleCapacity
Most idle allocations retained, 1..RENDER_GRAPH_POOL_CAPACITY.

Returns

InvalidState when already initialized, InvalidDescription for a capacity outside its range, OutOfMemory when bookkeeping cannot be allocated, otherwise the device admission status; failure leaves the pool empty.

Related types: foundation::uint32 · rhi::RasterStatus · rhi::DeviceHandle

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/render_graph.hpp

Trim

void ludus::graphics::renderer::RenderGraphAttachmentPool::Trim() noexcept
Destroy every idle allocation; RHI retires their pending GPU uses. Leased ones are unaffected.

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/render_graph.hpp

GetReport

RenderGraphPoolReport ludus::graphics::renderer::RenderGraphAttachmentPool::GetReport() const noexcept
Copy the counters; an uninitialized pool reports zeros.

Related types: RenderGraphPoolReport

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/render_graph.hpp

Reset

void ludus::graphics::renderer::RenderGraphAttachmentPool::Reset() noexcept
Destroy idle allocations and unbind the device.

Precondition

No graph initialized with this pool still exists; leases are asserted to be zero.

Declared in modules/graphics/renderer/include/ludus/graphics/renderer/render_graph.hpp