Skip to content

@orillusion/core


Class: RenderGraphResourcePool ​

Defined in: src/gfx/renderJob/graph/RenderGraphResourcePool.ts:38

Thin name → getter registry with an optional kind sidecar. Resources are owned by their creator pass (or by external subsystems like RTResourceMap / GBufferFrame); this pool just maps a string handle to a () => T lookup so other passes can resolve dependencies via ctx.get(name) at execute time.

Each RenderGraph owns one pool. Pass.setup populates it via RenderGraphBuilder.write(name, factory) (the factory's return is captured into a getter that always returns that same instance), or via the typed builders (b.createRenderTarget, etc.) which also stamp a kind.

Constructors ​

Constructor ​

new RenderGraphResourcePool(ctx): RenderGraphResourcePool

Defined in: src/gfx/renderJob/graph/RenderGraphResourcePool.ts:49

Parameters ​

ctx ​

Context3D

Returns ​

RenderGraphResourcePool

Accessors ​

context ​

Get Signature ​

get context(): Context3D

Defined in: src/gfx/renderJob/graph/RenderGraphResourcePool.ts:53

Returns ​

Context3D

Methods ​

register() ​

register(name, getter, kind?): void

Defined in: src/gfx/renderJob/graph/RenderGraphResourcePool.ts:64

Register a getter under name. Subsequent get(name) / has(name) calls resolve through this getter. Calling twice with the same name overwrites the previous getter — the graph's single-creator validator catches the production case; in tests this is convenient for swapping fakes. The optional kind defaults to 'opaque' so existing call-sites that pre-date the typed builders keep working.

Parameters ​

name ​

string

getter ​

() => unknown

kind? ​

ResourceKind = 'opaque'

Returns ​

void


markPersistent() ​

markPersistent(name): void

Defined in: src/gfx/renderJob/graph/RenderGraphResourcePool.ts:73

Mark name as persistent — the transient pool will not allocate or alias a wrapper for it. The persistent flag is independent of the kind tag: any kind can be marked persistent. Calling on an unregistered name still records the flag (set on register).

Parameters ​

name ​

string

Returns ​

void


isPersistent() ​

isPersistent(name): boolean

Defined in: src/gfx/renderJob/graph/RenderGraphResourcePool.ts:77

Parameters ​

name ​

string

Returns ​

boolean


unregister() ​

unregister(name): void

Defined in: src/gfx/renderJob/graph/RenderGraphResourcePool.ts:85

Drop the getter for name. Idempotent — silently no-ops if the name isn't registered. Called from RenderGraph.remove() and from RenderGraph.replace()'s pre-install cleanup so old getters don't outlive their owning pass.

Parameters ​

name ​

string

Returns ​

void


get() ​

get<T>(name): T

Defined in: src/gfx/renderJob/graph/RenderGraphResourcePool.ts:92

Resolve a named resource. Throws if no getter is registered.

Type Parameters ​

T ​

T

Parameters ​

name ​

string

Returns ​

T


has() ​

has(name): boolean

Defined in: src/gfx/renderJob/graph/RenderGraphResourcePool.ts:101

Parameters ​

name ​

string

Returns ​

boolean


kindOf() ​

kindOf(name): ResourceKind

Defined in: src/gfx/renderJob/graph/RenderGraphResourcePool.ts:106

Return the kind tag for name, or null if unregistered.

Parameters ​

name ​

string

Returns ​

ResourceKind


dispose() ​

dispose(): void

Defined in: src/gfx/renderJob/graph/RenderGraphResourcePool.ts:114

Drop all registrations. Called from graph.destroy() and on device-lost. The actual GPU resources are owned by the creator passes (or external maps), which manage their own destruction.

Returns ​

void