Skip to content

FlushReason

Defined in: frameCapture.ts:29

Every function here reads from WASM-owned memory and returns values the caller may hold across later frames. To stay safe when WASM memory grows or the renderer reuses its capture buffer, we never return a typed array that views the WASM heap — we copy primitives into fresh JS objects / buffers before returning.

  • decodeFrameCapture copies every field out as plain numbers and numeric arrays. The intermediate DataView and Uint32Array views are local and dropped as soon as the function returns.
  • getSnapshotImageData reads pixel rows from the heap view into a freshly-allocated Uint8ClampedArray (“flipped”) and wraps that JS-owned buffer in the returned ImageData.

Do NOT “optimize” either function by returning a heap-backed typed array directly — a subsequent WASM alloc/grow would detach it or the renderer would overwrite the bytes on the next capture, handing the caller silent corruption.

BatchFull: 0

Defined in: frameCapture.ts:30


BlendModeChange: 5

Defined in: frameCapture.ts:35


FrameEnd: 8

Defined in: frameCapture.ts:38


MaterialChange: 4

Defined in: frameCapture.ts:34


ScissorChange: 2

Defined in: frameCapture.ts:32


StageEnd: 6

Defined in: frameCapture.ts:36


StencilChange: 3

Defined in: frameCapture.ts:33


TextureSlotsFull: 1

Defined in: frameCapture.ts:31


TypeChange: 7

Defined in: frameCapture.ts:37