save

fun save()(source)

Writes the captured frame to every path queued for it, as a PNG file with every pixel opaque, and frees the read-back memory. Call it once, after the command buffer the capture was recorded into has been submitted with CommandBuffer.submitAndAcquireFence and GpuDevice.waitFor has returned for that fence; earlier, the memory does not hold the frame yet.

Failures do not throw: a path that cannot be written, or a read-back that cannot be mapped, prints one line to standard error through printError, and the other paths are still written.

Throws

if the capture has already been saved.