Unified pixel readback. Hides three backend differences from callers:
Method-signature dispatch — WebGL2's readRenderTargetPixelsAsync
takes a destination buffer; WebGPU's returns the result.
WebGPU row padding — WebGPU's copyTextureToBuffer rounds
bytesPerRow up to 256; this primitive runs
compactWebGPUReadbackRows unconditionally (no-op for
aligned widths or under WebGL2).
Readback Y orientation — native WebGPU returns top-down rows
and takes top-down region coordinates; WebGLRenderer and
WebGPURenderer's WebGL2 fallback use bottom-up rows and coordinates.
caps.readbackYDown follows the active backend; framebufferYDown
describes shader sampling, which differs on the fallback. Native
top-down readback was verified with three r185 on M4 and Dawn/SwiftShader.
Returns top-down rows by default; flipY: true returns bottom-up
rows for consumers such as EXR export.
Unified pixel readback. Hides three backend differences from callers:
readRenderTargetPixelsAsynctakes a destination buffer; WebGPU's returns the result.copyTextureToBufferroundsbytesPerRowup to 256; this primitive runs compactWebGPUReadbackRows unconditionally (no-op for aligned widths or under WebGL2).caps.readbackYDownfollows the active backend;framebufferYDowndescribes shader sampling, which differs on the fallback. Native top-down readback was verified with three r185 on M4 and Dawn/SwiftShader. Returns top-down rows by default;flipY: truereturns bottom-up rows for consumers such as EXR export.