150 static constexpr u32 kSlotBits = 16;
151 static constexpr u32 kSlotMask = (1u << kSlotBits) - 1;
157 std::vector<Entry> entries_;
GPU framebuffer abstraction for render-to-texture.
Backend-agnostic graphics enumerations.
Core type definitions and utilities for ESEngine.
Abstract graphics device interface.
u64 idleByteBudget() const
void setIdleByteBudget(u64 bytes)
static constexpr u64 kIdleByteBudget
Bytes of unborrowed targets the pool keeps, whatever their age: past it the longest idle are destroye...
void release(TargetHandle handle)
TargetPool(GfxDevice &device)
TextureHandle gbufferTextureOf(TargetHandle handle) const
TextureHandle albedoTextureOf(TargetHandle handle) const
TargetPool & operator=(const TargetPool &)=delete
static constexpr u32 kIdleTicksBeforeEvict
Ticks a target may go unborrowed before the pool destroys it.
TextureHandle textureOf(TargetHandle handle) const
bool holds(TargetHandle handle) const
TargetHandle acquire(const TargetShape &shape)
Borrow a target of this shape, reusing one or creating it.
static constexpr u32 kBudgetGraceTicks
Ticks unborrowed before a target counts against that budget. More than one, since age runs once per g...
TextureHandle depthTextureOf(TargetHandle handle) const
FramebufferHandle framebufferOf(TargetHandle handle) const
TargetPool(const TargetPool &)=delete
void age()
One tick of the clock every borrowed target is aged against.
u32 TargetHandle
A borrowed target: a slot index, and the generation of what is in it.
constexpr TargetHandle kNoTarget
FramebufferHandle
Handle 0 is the default framebuffer (backbuffer); it cannot be created or deleted.
std::uint64_t u64
Unsigned 64-bit integer.
std::unique_ptr< T > Unique
Unique ownership smart pointer.
std::uint32_t u32
Unsigned 32-bit integer.
bool gbuffer
A second colour attachment for the surface's material (see FramebufferSpec::gbuffer).
bool storage
Written by a compute shader as a storage texture, and sampled after.