releaseTransientRenderTargets function Rendering

int releaseTransientRenderTargets()

Drops every transient render-graph attachment currently held and returns the bytes released.

These are the intermediate render targets (shadow atlas, HDR scene color, depth, and the post-process chain), pooled per view and per frame in flight. The pool has no eviction of its own, so it settles at the high-water mark of every attachment shape any frame has needed and holds that for the life of the process. In a scene-heavy app it is routinely the largest thing the engine pins.

Everything dropped is reallocated by the next frame that needs it, so the cost is one frame's allocation. Loaded textures and scene templates are not touched, so a live scene keeps everything it is drawing with.

Called automatically on platform memory pressure. Call it directly when the app knows something the platform does not, such as being about to decode a large asset.

Implementation

int releaseTransientRenderTargets() => Surface.shedTransientRenderTargets();