RenderGraphCaptureResult.fromJson constructor

RenderGraphCaptureResult.fromJson(
  1. Map<String, Object?> json
)

Rebuilds a capture from toJson output. GPU textures are not restored; thumbnails serialized with images come back as CapturedResource.thumbnailPng, and shader names and decoded uniforms keep what they were serialized with.

Implementation

factory RenderGraphCaptureResult.fromJson(Map<String, Object?> json) =>
    RenderGraphCaptureResult(
      passes: [
        for (final pass in json['passes'] as List? ?? const [])
          CapturedPass.fromJson((pass as Map).cast()),
      ],
      resources: [
        for (final resource in json['resources'] as List? ?? const [])
          CapturedResource.fromJson((resource as Map).cast()),
      ],
      pixelWidth: json['pixelWidth'] as int? ?? 0,
      pixelHeight: json['pixelHeight'] as int? ?? 0,
    );