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.

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.