trace library

Recording what a device was asked, keeping it as a .f3dtrace file, and asking it again of any backend — H3.

final recording = RecordingDevice(device);
final renderer = Renderer.create(device: recording);
final frame = renderer.render(...);
await recording.readback(frame.frame);
final bytes = Trace(recording.events).encode();

final replay = await replayTrace(Trace.decode(bytes), otherDevice);
replay.pixels.single; // the same frame, drawn by the other backend

A library of its own rather than part of flutter3d_hardware.dart: an application draws without it, and a tool or a test that wants it asks.

Classes

RecordingDevice
Trace
Calls made of a device, in order, with every resource named by an id.
TraceBeginComputePass
TraceBeginFrame
TraceBeginRenderPass
TraceBindIndexBuffer
TraceBindIndexData
TraceBindPipeline
TraceBindTexture
TraceBindUniformBlock
TraceBindVertexBuffer
TraceBindVertexData
TraceBlobReader
Reads payloads back out of a trace's blob.
TraceBlobWriter
Collects the byte payloads of a trace into one buffer, handing back where each landed.
TraceClearBindings
TraceColorTarget
One colour attachment, with its textures named by id: a ColorTarget as a trace writes it.
TraceComputeBindPipeline
TraceComputeBindStorageBuffer
TraceComputeBindUniformBlock
TraceComputeSubmit
TraceCreateComputePipeline
TraceCreateCubeRenderTarget
TraceCreateCubeTextureFromPixels
TraceCreatePipeline
TraceCreateStorageBuffer
TraceCreateTexture
TraceCreateTextureFromPixels
TraceDepthTarget
The depth attachment, with its texture named by id: a DepthTarget as a trace writes it. A class for TraceColorTarget's reason, with DepthTarget's defaults.
TraceDispatch
TraceDraw
TraceEvent
TraceInsertDebugMarker
PassEncoder.insertDebugMarker.
TraceLabeled
What kind of resource a TraceSetLabel names, which says whose ids its number is among.
TraceLoadShaders
TraceOverwriteGeometry
TraceOverwriteTexture
TracePassEvent
An event recorded into an open render pass.
TracePopDebugGroup
PassEncoder.popDebugGroup.
TracePushDebugGroup
PassEncoder.pushDebugGroup: a named group opened in pass pass.
TraceReadback
TraceReadBuffer
TraceReadPixels
TraceReleaseGeometry
TraceReleaseStorageBuffer
TraceReleaseTexture
TraceReplay
What a replay read back, in the order the trace asked.
TraceSetAlphaToCoverage
PassEncoder.setAlphaToCoverage — P7. A trace recorded before it had none, which replays as it was recorded: off.
TraceSetBlend
TraceSetBlendColor
TraceSetCullMode
TraceSetDepthCompare
TraceSetDepthWrite
TraceSetLabel
GraphicsDevice.setLabel: label given to a resource the trace made.
TraceSetPolygonMode
TraceSetPrimitiveType
TraceSetScissor
TraceSetStencil
TraceSetStencilReference
TraceSetViewport
TraceSetWindingOrder
TraceSubmit
TraceUploadGeometry

Functions

replayTrace(Trace trace, GraphicsDevice device) → Future<TraceReplay>
Issues every call of trace against device and collects what it reads.

Typedefs

TraceGeometryRange = ({int buffer, int length, int offset})
A slice of a geometry buffer: which buffer, and which bytes of it.

Exceptions / Errors

TraceFormatException
A .f3dtrace that is not one, is newer than this build reads, or names something this build has no value for.