Skip to content

Documentation / scene / RGExecuteContext

Interface: RGExecuteContext

Defined in: libs/scene/src/render/rendergraph/types.ts:121

Context passed to pass execute callbacks during graph execution.

Provides access to resolved GPU resources by their handles.

Methods

getTexture()

getTexture<TTexture>(handle): TTexture

Defined in: libs/scene/src/render/rendergraph/types.ts:133

Resolve a handle to the actual GPU texture object.

For transient resources, this returns the texture allocated by the executor. For imported resources, this returns the texture registered via RenderGraphExecutor.setImportedTexture. The handle must be declared by the current pass with RGPassBuilder.read or RGPassBuilder.write.

Type Parameters

TTexture

TTexture = unknown

Parameters

handle

RGHandle

Handle of the resource to resolve.

Returns

TTexture

The resolved texture object (type depends on the allocator).


getFramebuffer()

getFramebuffer<TFramebuffer>(handle): TFramebuffer

Defined in: libs/scene/src/render/rendergraph/types.ts:144

Resolve a framebuffer handle to the actual backend framebuffer object.

The handle must be declared by the current pass with RGPassBuilder.read or created by the same pass with RGPassBuilder.createFramebuffer.

Type Parameters

TFramebuffer

TFramebuffer = unknown

Parameters

handle

RGHandle

Handle returned from RGPassBuilder.createFramebuffer.

Returns

TFramebuffer

The resolved framebuffer object (type depends on the allocator).


createFramebuffer()

createFramebuffer<TFramebuffer>(desc): TFramebuffer

Defined in: libs/scene/src/render/rendergraph/types.ts:158

Create a temporary framebuffer managed by the graph executor.

The framebuffer is released automatically when graph execution finishes or aborts. Attachments may be actual backend resources or texture formats, depending on the allocator implementation. If an attachment is an RGHandle, the current pass must declare it with RGPassBuilder.read or RGPassBuilder.write.

Type Parameters

TFramebuffer

TFramebuffer = unknown

Parameters

desc

RGFramebufferDesc

Framebuffer descriptor.

Returns

TFramebuffer

The allocated framebuffer object (type depends on the allocator).


deferCleanup()

deferCleanup(callback): void

Defined in: libs/scene/src/render/rendergraph/types.ts:171

Register a cleanup callback to run when graph execution finishes or aborts.

Callbacks run in reverse registration order. Use this for temporary objects created inside pass execution that are not graph resources, such as pooled framebuffers wrapping graph-managed textures. If pass execution throws, the executor still runs cleanup callbacks and preserves the original pass error ahead of cleanup errors.

Parameters

callback

() => void

Cleanup function to invoke after execution.

Returns

void

Released under the MIT License.