toJson method
Implementation
@override
Map<String, Object?> toJson(TraceBlobWriter blob) => <String, Object?>{
'pass': pass,
'label': label,
'colors': <Object?>[
for (final c in colors)
<String, Object?>{
'texture': c.texture,
'resolveTexture': c.resolveTexture,
'loadAction': loadActionWire.write(c.loadAction),
'storeAction': storeActionWire.write(c.storeAction),
'clearValue': c.clearValue == null
? null
: vector4ToJson(c.clearValue!),
'face': c.face,
'mipLevel': c.mipLevel,
// Since 1.0, written only when set, so a trace of a pass at layer
// zero is byte for byte what it was.
if (c.layer != 0) 'layer': c.layer,
},
],
'depth': switch (depth) {
null => null,
final d => <String, Object?>{
'texture': d.texture,
'clearValue': d.clearValue,
'loadAction': loadActionWire.write(d.loadAction),
'storeAction': storeActionWire.write(d.storeAction),
'stencilLoadAction': loadActionWire.write(d.stencilLoadAction),
'stencilStoreAction': storeActionWire.write(d.stencilStoreAction),
'stencilClearValue': d.stencilClearValue,
if (d.mipLevel != 0) 'mipLevel': d.mipLevel,
if (d.layer != 0) 'layer': d.layer,
if (d.face != 0) 'face': d.face,
if (d.depthReadOnly) 'depthReadOnly': true,
if (d.stencilReadOnly) 'stencilReadOnly': true,
},
},
};