Skip to content

ZenFG TypeScript API / webgpu / root / FrameGraphRecorder

Interface: FrameGraphRecorder ​

Defined in: packages/webgpu/src/types.ts:1417

Application-facing single-use ordered recording object.

Extends ​

Methods ​

clearBuffer() ​

clearBuffer(desc): void

Defined in: packages/webgpu/src/types.ts:1356

Declares inferred-access buffer clears.

Parameters ​

desc ​

ClearBufferNodeDesc

Returns ​

void

Inherited from ​

FrameGraphRecording.clearBuffer


command() ​

command(desc): void

Defined in: packages/webgpu/src/types.ts:1358

Declares caller-defined commands encoded into a FrameGraph-owned segment.

Parameters ​

desc ​

CommandNodeDesc

Returns ​

void

Inherited from ​

FrameGraphRecording.command


compile() ​

Call Signature ​

compile(): CompiledFrame

Defined in: packages/webgpu/src/types.ts:1426

Consumes this recorder and resolves ordered logical values into a compact, conditionally re-executable payload.

Returns ​

CompiledFrame

Remarks ​

The recorder is consumed atomically even when compilation fails.

Throws ​

If declarations are inconsistent or invalid, a debug group remains open, the runtime was destroyed, or this recorder was already consumed.

Call Signature ​

compile(options): CompiledFrame

Defined in: packages/webgpu/src/types.ts:1427

Parameters ​
options ​
report? ​

false

Returns ​

CompiledFrame

Call Signature ​

compile(options): CompiledFrameWithReport

Defined in: packages/webgpu/src/types.ts:1429

Consumes this recorder and also returns a callback-free diagnostic snapshot.

Parameters ​
options ​
report ​

true

Returns ​

CompiledFrameWithReport


compute() ​

compute(desc): void

Defined in: packages/webgpu/src/types.ts:1352

Declares a compute-pass node.

Parameters ​

desc ​

ComputePassNodeDesc

Returns ​

void

Inherited from ​

FrameGraphRecording.compute


copy() ​

copy(desc): void

Defined in: packages/webgpu/src/types.ts:1354

Declares inferred-access copy operations.

Parameters ​

desc ​

CopyNodeDesc

Returns ​

void

Inherited from ​

FrameGraphRecording.copy


createBuffer() ​

createBuffer(desc, options?): BufferHandle

Defined in: packages/webgpu/src/types.ts:1316

Registers a transient buffer owned by this recording.

Parameters ​

desc ​

BufferDesc

options? ​

TransientResourceOptions

Returns ​

BufferHandle

Inherited from ​

FrameGraphRecording.createBuffer


createTexture() ​

createTexture(desc, options?): TextureHandle

Defined in: packages/webgpu/src/types.ts:1308

Registers a transient texture owned by this recording.

Parameters ​

desc ​

TextureDesc

options? ​

TransientResourceOptions

Returns ​

TextureHandle

Remarks ​

The descriptor is snapshotted and physical allocation is deferred until execution.

Throws ​

If the descriptor is invalid, or the runtime/recorder is unusable.

Inherited from ​

FrameGraphRecording.createTexture


createTextureView() ​

createTextureView(texture, desc?): TextureViewHandle

Defined in: packages/webgpu/src/types.ts:1312

Creates a logical view whose subresource selection participates in dependencies.

Parameters ​

texture ​

TextureHandle

desc? ​

TextureViewDesc

Returns ​

TextureViewHandle

Inherited from ​

FrameGraphRecording.createTextureView


externalSubmission() ​

externalSubmission(desc): void

Defined in: packages/webgpu/src/types.ts:1365

Declares an opaque caller-owned submission node; retained nodes split execution segments.

Parameters ​

desc ​

ExternalSubmissionNodeDesc

Returns ​

void

Remarks ​

The callback is an ordering boundary, not a GPU-completion fence.

Inherited from ​

FrameGraphRecording.externalSubmission


getBufferDesc() ​

getBufferDesc(handle): Readonly<BufferDesc>

Defined in: packages/webgpu/src/types.ts:1318

Returns snapshotted metadata for a buffer owned by this recording.

Parameters ​

handle ​

BufferHandle

Returns ​

Readonly<BufferDesc>

Inherited from ​

FrameGraphRecording.getBufferDesc


getTextureDesc() ​

getTextureDesc(handle): Readonly<TextureDesc>

Defined in: packages/webgpu/src/types.ts:1310

Returns snapshotted metadata for a texture owned by this recording.

Parameters ​

handle ​

TextureHandle

Returns ​

Readonly<TextureDesc>

Inherited from ​

FrameGraphRecording.getTextureDesc


getTextureViewDesc() ​

getTextureViewDesc(handle): Readonly<NormalizedTextureViewDesc>

Defined in: packages/webgpu/src/types.ts:1314

Returns normalized metadata for a logical texture view.

Parameters ​

handle ​

TextureViewHandle

Returns ​

Readonly<NormalizedTextureViewDesc>

Inherited from ​

FrameGraphRecording.getTextureViewDesc


importBuffer() ​

importBuffer(buffer, options?): BufferHandle

Defined in: packages/webgpu/src/types.ts:1332

Borrows a caller-owned buffer with fixed identity for this recording.

Parameters ​

buffer ​

GPUBuffer

options? ​

ImportBufferOptions

Returns ​

BufferHandle

Inherited from ​

FrameGraphRecording.importBuffer


importSwapchainTexture() ​

importSwapchainTexture(texture, options?): TextureHandle

Defined in: packages/webgpu/src/types.ts:1330

Borrows the current swapchain texture; call markPresent() separately and execute the compiled frame while that borrowed texture remains current.

Parameters ​

texture ​

GPUTexture

options? ​

ImportSwapchainTextureOptions

Returns ​

TextureHandle

Inherited from ​

FrameGraphRecording.importSwapchainTexture


importTexture() ​

importTexture(texture, options?): TextureHandle

Defined in: packages/webgpu/src/types.ts:1325

Borrows a caller-owned texture with fixed identity for this recording.

Parameters ​

texture ​

GPUTexture

options? ​

ImportTextureOptions

Returns ​

TextureHandle

Remarks ​

Ownership and destruction remain with the caller.

Throws ​

If the exposure options conflict with the native texture.

Inherited from ​

FrameGraphRecording.importTexture


markDebugCapture() ​

Call Signature ​

markDebugCapture(resource): void

Defined in: packages/webgpu/src/types.ts:1387

Retains the final visible producer of a resource for debug capture.

Parameters ​
resource ​

TextureViewHandle | ResourceHandle

Returns ​

void

Inherited from ​

FrameGraphRecording.markDebugCapture

Call Signature ​

markDebugCapture(buffer, range): void

Defined in: packages/webgpu/src/types.ts:1388

Parameters ​
buffer ​

BufferHandle

range ​

BufferRange

Returns ​

void

Inherited from ​

FrameGraphRecording.markDebugCapture


markOutput() ​

Call Signature ​

markOutput(resource): void

Defined in: packages/webgpu/src/types.ts:1376

Marks the final logical value of a texture or buffer as a required graph output.

This marker only retains the value's visible producers. It does not return, unwrap, transfer ownership of, or extend the execution lifetime of a transient physical resource. Post-execution access requires caller-owned imported storage.

Parameters ​
resource ​

TextureViewHandle | ResourceHandle

Returns ​

void

Inherited from ​

FrameGraphRecording.markOutput

Call Signature ​

markOutput(buffer, range): void

Defined in: packages/webgpu/src/types.ts:1377

Parameters ​
buffer ​

BufferHandle

range ​

BufferRange

Returns ​

void

Inherited from ​

FrameGraphRecording.markOutput


markPersistentState() ​

Call Signature ​

markPersistentState(resource): void

Defined in: packages/webgpu/src/types.ts:1379

Retains the final producer of caller-owned state needed by a later frame.

Parameters ​
resource ​

TextureViewHandle | ResourceHandle

Returns ​

void

Inherited from ​

FrameGraphRecording.markPersistentState

Call Signature ​

markPersistentState(buffer, range): void

Defined in: packages/webgpu/src/types.ts:1380

Parameters ​
buffer ​

BufferHandle

range ​

BufferRange

Returns ​

void

Inherited from ​

FrameGraphRecording.markPersistentState


markPresent() ​

markPresent(resource): void

Defined in: packages/webgpu/src/types.ts:1367

Retains the final visible producer of a swapchain texture for presentation.

Parameters ​

resource ​

TextureHandle

Returns ​

void

Inherited from ​

FrameGraphRecording.markPresent


markReadback() ​

markReadback(resource, range?): void

Defined in: packages/webgpu/src/types.ts:1385

Retains the final visible producer of a caller-owned staging buffer imported with graph-visible GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ.

Parameters ​

resource ​

BufferHandle

range? ​

BufferRange

Returns ​

void

Inherited from ​

FrameGraphRecording.markReadback


popDebugGroup() ​

popDebugGroup(): void

Defined in: packages/webgpu/src/types.ts:1292

Closes the innermost diagnostic group.

Returns ​

void

Inherited from ​

FrameGraphRecording.popDebugGroup


pushDebugGroup() ​

pushDebugGroup(label): void

Defined in: packages/webgpu/src/types.ts:1290

Opens a distinct diagnostic-only group for subsequently registered resources and nodes. Labels need not be unique.

Parameters ​

label ​

string

Returns ​

void

Inherited from ​

FrameGraphRecording.pushDebugGroup


render() ​

render(desc): void

Defined in: packages/webgpu/src/types.ts:1350

Declares a render-pass node.

Parameters ​

desc ​

RenderPassNodeDesc

Returns ​

void

Throws ​

If an attachment, native descriptor extras, declared use, or encode callback contract is invalid.

Inherited from ​

FrameGraphRecording.render


use() ​

Call Signature ​

use<TAccess>(resource, access): TextureUse<TAccess>

Defined in: packages/webgpu/src/types.ts:1334

Creates a reusable texture-read declaration resolved at each node that lists it.

Type Parameters ​
TAccess ​

TAccess extends TextureReadAccess

Parameters ​
resource ​

TextureHandle

access ​

TAccess

Returns ​

TextureUse<TAccess>

Inherited from ​

FrameGraphRecording.use

Call Signature ​

use<TAccess>(resource, access, options): TextureUse<TAccess>

Defined in: packages/webgpu/src/types.ts:1336

Creates a reusable texture-write declaration resolved at each node that lists it.

Type Parameters ​
TAccess ​

TAccess extends TextureWriteAccess

Parameters ​
resource ​

TextureHandle

access ​

TAccess

options ​

WriteUseOptions

Returns ​

TextureUse<TAccess>

Inherited from ​

FrameGraphRecording.use

Call Signature ​

use<TAccess>(resource, access): TextureViewUse<TAccess>

Defined in: packages/webgpu/src/types.ts:1338

Creates a reusable read declaration for a subresource-selecting logical view.

Type Parameters ​
TAccess ​

TAccess extends TextureViewReadAccess

Parameters ​
resource ​

TextureViewHandle

access ​

TAccess

Returns ​

TextureViewUse<TAccess>

Inherited from ​

FrameGraphRecording.use

Call Signature ​

use<TAccess>(resource, access, options): TextureViewUse<TAccess>

Defined in: packages/webgpu/src/types.ts:1340

Creates a reusable write declaration for a subresource-selecting logical view.

Type Parameters ​
TAccess ​

TAccess extends TextureViewWriteAccess

Parameters ​
resource ​

TextureViewHandle

access ​

TAccess

options ​

WriteUseOptions

Returns ​

TextureViewUse<TAccess>

Inherited from ​

FrameGraphRecording.use

Call Signature ​

use<TAccess>(resource, access, options?): BufferUse<TAccess>

Defined in: packages/webgpu/src/types.ts:1342

Creates a reusable buffer-read declaration and snapshots its optional byte range.

Type Parameters ​
TAccess ​

TAccess extends BufferReadAccess

Parameters ​
resource ​

BufferHandle

access ​

TAccess

options? ​

BufferUseOptions

Returns ​

BufferUse<TAccess>

Inherited from ​

FrameGraphRecording.use

Call Signature ​

use<TAccess>(resource, access, options): BufferUse<TAccess>

Defined in: packages/webgpu/src/types.ts:1344

Creates a reusable buffer-write declaration with range and content semantics.

Type Parameters ​
TAccess ​

TAccess extends BufferWriteAccess

Parameters ​
resource ​

BufferHandle

access ​

TAccess

options ​

BufferWriteUseOptions

Returns ​

BufferUse<TAccess>

Inherited from ​

FrameGraphRecording.use


withDebugGroup() ​

withDebugGroup<T>(label, record): T

Defined in: packages/webgpu/src/types.ts:1297

Runs synchronous recording work inside a distinct diagnostic-only group. Promise-like return values are rejected. Labels need not be unique.

Type Parameters ​

T ​

T

Parameters ​

label ​

string

record ​

() => T extends PromiseLike<unknown> ? never : T

Returns ​

T

Inherited from ​

FrameGraphRecording.withDebugGroup

Open source / MIT licensed