/** * End-to-end native WebGPU character frame graph. * * Character color, character motion/depth, and temporal resolve are encoded in * one command buffer and submitted once. Only final evidence pixels and compact * timestamp metadata may cross back to the CPU. */ import { type CharacterMotionTextureRasterReceipt } from '../../character-render/CharacterMotionTextureRasterizer'; import { type CharacterMotionVectorReceipt } from '../../character-render/CharacterMotionVectors'; import { type CharacterTextureRenderReceipt } from '../../character-render/CharacterTextureRenderer'; import { type CharacterRenderOptions } from '../../character-render/character-render'; import type { CharacterDrawSpec } from '../../native-render/draw-spec'; import type { PixelGrid } from '../../native-render/gpu-verify'; import type { Mat4 } from '../../character-render/skin-math'; import { type TemporalTextureResolveReceipt } from './TemporalConvergence'; export interface CharacterTemporalFrameGraphOptions { width: number; height: number; enableGpuTimestamps?: boolean; label?: string; } export interface CharacterTemporalFrameGraphInput { currentSpec: CharacterDrawSpec; previousSpec: CharacterDrawSpec; currentViewProjection?: Mat4; previousViewProjection?: Mat4; renderOptions?: Omit; feedback: number; historyValid: boolean; disocclusionDepthThreshold?: number; capturePixels?: boolean; } export interface CharacterTemporalStageDurations { characterColorNanoseconds: number | null; motionDepthNanoseconds: number | null; temporalResolveNanoseconds: number | null; aggregateNanoseconds: number | null; } /** Caller-owned timestamp ranges used when this graph is nested in a larger frame graph. */ export interface CharacterTemporalTimestampWrites { color?: GPURenderPassTimestampWrites; motionDepth?: GPURenderPassTimestampWrites; temporalResolve?: GPUComputePassTimestampWrites; } export interface CharacterTemporalCompletionAccounting { evidenceFrameReadbackCount: 0 | 1; timestampMetadataReadbackCount: 0 | 1; gpuTimestampQueryRequested: boolean; gpuTimestampQueryEnabled: boolean; } export interface CharacterTemporalFrameGraphReceipt { schemaVersion: 'holoscript.webgpu-character-temporal-frame-graph.v1'; backend: 'webgpu'; deviceExecutionMeasured: true; width: number; height: number; frameIndex: number; historyInitializedBeforeFrame: boolean; historyConsumed: boolean; historyCommitted: true; fixedTopology: true; persistentGpuResources: true; zeroCopyColorToTemporalResolve: true; zeroCopyMotionDepthToTemporalResolve: true; zeroCopyResolveToHistory: true; intermediateFrameReadbackCount: 0; evidenceFrameReadbackCount: 0 | 1; timestampMetadataReadbackCount: 0 | 1; commandBufferCount: 1; queueSubmissionCount: 1; gpuTimestampQuerySupported: boolean; gpuTimestampQueryRequested: boolean; gpuTimestampQueryEnabled: boolean; gpuTimestampMeasured: boolean; timingClassification: 'gpu-timestamp-query' | 'feature-not-enabled' | 'not-requested'; timedScope: 'character-color-through-temporal-resolve-gpu-scope' | 'not-measured'; cpuMotionDerivationExcludedFromTimedScope: true; cpuToGpuUploadsExcludedFromTimedScope: true; historyCopiesExcludedFromTimedScope: true; evidenceAndTimestampReadbackExcludedFromTimedScope: true; durations: CharacterTemporalStageDurations; motionDerivation: CharacterMotionVectorReceipt; color: CharacterTextureRenderReceipt; motionDepth: CharacterMotionTextureRasterReceipt; resolve: TemporalTextureResolveReceipt; } export interface CharacterTemporalFrameGraphResult { outputTexture: GPUTexture; pixels: PixelGrid | null; receipt: CharacterTemporalFrameGraphReceipt; } /** * A recorded character frame whose history commit and receipt finalization are * deliberately deferred to the owner of the command encoder. */ export interface EncodedCharacterTemporalFrame { readonly outputTexture: GPUTexture; readonly frameIndex: number; encodeHistoryCommit(encoder: GPUCommandEncoder): void; complete(durations: CharacterTemporalStageDurations, accounting: CharacterTemporalCompletionAccounting): CharacterTemporalFrameGraphReceipt; cancel(): void; } /** One-device, fixed-topology character render graph. Execute calls are serialized. */ export declare class CharacterTemporalFrameGraph { readonly width: number; readonly height: number; readonly timestampQuerySupported: boolean; readonly timestampQueryRequested: boolean; readonly timestampQueryEnabled: boolean; private readonly device; private readonly label; private readonly characterRenderer; private readonly motionRasterizer; private readonly currentColor; private readonly outputColor; private readonly historyColor; private readonly historyDepth; private readonly neutralReactiveMask; private readonly resolvePipeline; private readonly timestampQuerySet; private readonly timestampResolveBuffer; private readonly timestampReadbackBuffer; private historyInitialized; private frameIndex; private executing; private destroyed; constructor(device: GPUDevice, initialSpec: CharacterDrawSpec, options: CharacterTemporalFrameGraphOptions); resetHistory(): void; /** Persistent temporal output, exposed for zero-copy downstream composition. */ get outputTexture(): GPUTexture; /** * Record color, motion/depth, and temporal resolve into a caller-owned * encoder. The caller must commit history and call complete() after the * submitted work has finished, or call cancel() if encoding is abandoned. */ encodeInto(encoder: GPUCommandEncoder, input: CharacterTemporalFrameGraphInput, timestampWrites?: CharacterTemporalTimestampWrites): EncodedCharacterTemporalFrame; execute(input: CharacterTemporalFrameGraphInput): Promise; destroy(): void; } //# sourceMappingURL=CharacterTemporalFrameGraph.d.ts.map