RenderTargetPool class final

Reuses intermediate render targets (depth, MSAA colour, shadow maps, post-processing buffers) from frame to frame instead of allocating new ones.

Take targets with acquire while recording a frame and call endFrame once it is submitted: everything taken becomes free for the next frame, and a target nobody asks for again for keepFrames frames is dropped. The texture Flutter shows is never pooled; it comes from a GpuSurface, which knows when Flutter is done with it.

Constructors

RenderTargetPool(GpuDevice device, {int keepFrames = 3})
A pool creating its textures on device.

Properties

device → GpuDevice
Where textures are created.
final
hashCode → int
The hash code for this object.
no setterinherited
keepFrames → int
Frames an unused target is kept for.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → int
Textures alive in the pool, taken or free.
no setter

Methods

acquire(GpuTextureDesc desc) → GpuTexture
A texture matching desc for this frame.
clear() → void
Drops every texture.
endFrame() → void
Frees everything taken this frame and drops long-unused targets.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited