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.readPixels(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
TraceComputeBindPipeline
TraceComputeBindStorageBuffer
TraceComputeBindUniformBlock
TraceComputeSubmit
TraceCreateComputePipeline
TraceCreateCubeRenderTarget
TraceCreateCubeTextureFromPixels
TraceCreatePipeline
TraceCreateStorageBuffer
TraceCreateTexture
TraceCreateTextureFromPixels
TraceDispatch
TraceDraw
TraceEvent
TraceLoadShaders
TraceOverwriteGeometry
TraceOverwriteTexture
TracePassEvent
An event recorded into an open render pass.
TraceReadback
TraceReadBuffer
TraceReadPixels
TraceReleaseGeometry
TraceReleaseStorageBuffer
TraceReleaseTexture
TraceReplay
What a replay read back, in the order the trace asked.
TraceSetBlend
TraceSetBlendColor
TraceSetCullMode
TraceSetDepthCompare
TraceSetDepthWrite
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

TraceColorTarget = ({Vector4? clearValue, int face, LoadAction loadAction, int mipLevel, int? resolveTexture, StoreAction storeAction, int texture})
One colour attachment, with its textures named by id.
TraceDepthTarget = ({double clearValue, LoadAction loadAction, int stencilClearValue, LoadAction stencilLoadAction, StoreAction stencilStoreAction, StoreAction storeAction, int texture})
The depth attachment, with its texture named by id.
TraceGeometryRange = ({int buffer, int length, int offset})
A slice of a geometry buffer: which buffer, and which bytes of it.