Skip to content

Documentation / scene / HistoryResourceManager

Class: HistoryResourceManager<TTexture> ​

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:23

Manages render graph textures retained across frames.

Type Parameters ​

TTexture ​

TTexture = Texture2D

Constructors ​

Constructor ​

new HistoryResourceManager<TTexture>(allocator): HistoryResourceManager<TTexture>

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:34

Create a history manager using the given allocator.

Parameters ​

allocator ​

RGTextureAllocator<TTexture>

Returns ​

HistoryResourceManager<TTexture>

Accessors ​

frameActive ​

Get Signature ​

get frameActive(): boolean

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:59

Whether a history frame is active.

Returns ​

boolean

Methods ​

getPrevious() ​

getPrevious(name): TTexture

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:42

Return a previous-frame texture from the active read scope.

Parameters ​

name ​

string

Returns ​

TTexture

Throws ​

When the resource is not available in that scope.


tryGetPrevious() ​

tryGetPrevious(name): TTexture

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:54

Return a scoped previous-frame texture, or null.

Parameters ​

name ​

string

Returns ​

TTexture


isCompatible() ​

isCompatible(name, desc, size): boolean

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:64

Check for valid history matching the descriptor and size.

Parameters ​

name ​

string

desc ​

RGTextureDesc

size ​

RGResolvedSize

Returns ​

boolean


beginFrame() ​

beginFrame(): void

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:70

Begin collecting imports and commits for a frame.

Returns ​

void


importPrevious() ​

importPrevious(graph, name): RGHandle<RGHandleKind, unknown>

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:78

Import the latest history texture, or return null when unavailable.

Parameters ​

graph ​

RenderGraph

name ​

string

Returns ​

RGHandle<RGHandleKind, unknown>


importPreviousIfCompatible() ​

importPreviousIfCompatible(graph, name, desc, size): RGHandle<RGHandleKind, unknown>

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:92

Import the latest history only when its descriptor and size match.

Parameters ​

graph ​

RenderGraph

name ​

string

desc ​

RGTextureDesc

size ​

RGResolvedSize

Returns ​

RGHandle<RGHandleKind, unknown>


bindImportedTextures() ​

bindImportedTextures(executor): void

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:102

Bind this frame's history imports to an executor.

Parameters ​

executor ​

Pick<RenderGraphExecutor<TTexture>, "setImportedTexture">

Returns ​

void


beginReadScope() ​

beginReadScope(bindings): void

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:109

Push a history read scope for pass execution.

Parameters ​

bindings ​

object[]

Returns ​

void


endReadScope() ​

endReadScope(): void

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:118

Pop the latest history read scope.

Returns ​

void


queueCommit() ​

queueCommit(name, desc, size, texture, ownsTexture?): void

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:126

Queue the next history texture. It becomes visible on commitFrame; owned textures are released on discardFrame.

Parameters ​

name ​

string

desc ​

RGTextureDesc

size ​

RGResolvedSize

texture ​

TTexture

ownsTexture? ​

boolean = true

Returns ​

void


queueCommitFromGraph() ​

queueCommitFromGraph(name, desc, size, ctx, handle): TTexture

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:155

Retain and queue a graph texture from its declaring pass.

Parameters ​

name ​

string

desc ​

RGTextureDesc

size ​

RGResolvedSize

ctx ​

Pick<RGExecuteContext, "getTexture">

handle ​

RGHandle

Returns ​

TTexture


queueRetainedCommit() ​

queueRetainedCommit(name, desc, size, texture): void

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:168

Retain a texture through the allocator and queue it as history.

Parameters ​

name ​

string

desc ​

RGTextureDesc

size ​

RGResolvedSize

texture ​

TTexture

Returns ​

void


commitFrame() ​

commitFrame(): void

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:180

Commit all pending history writes.

Returns ​

void


discardFrame() ​

discardFrame(): void

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:217

Discard all pending history writes.

Returns ​

void


invalidate() ​

invalidate(name): void

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:235

Invalidate one named history resource without disturbing unrelated temporal effects. If called during a frame, owned textures are released after that frame so already-imported graph reads remain valid.

Parameters ​

name ​

string

Returns ​

void


dispose() ​

dispose(): void

Defined in: libs/scene/src/render/rendergraph/history_resource_manager.ts:276

Release all history resources.

Returns ​

void

Released under the MIT License.