[Webkit-unassigned] [Bug 235002] readPixels directly to ArrayBuffer has very high CPU usage

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 10 05:18:55 PST 2022


Kimmo Kinnunen <kkinnunen at apple.com> changed:

           What    |Removed                     |Added
                 CC|                            |kpiddington at apple.com
             Blocks|                            |223434

--- Comment #3 from Kimmo Kinnunen <kkinnunen at apple.com> ---
Thanks for the detailed analysis!

Yes, the readPixels is reading the underlying Metal texture row-by-row.
The underlying reason is that the general case of readPixels has a lot of edge-cases.
Also the general implementation has a memory-speed tradeoff characteristic for the simple implementation.

The ANGLE Metal backend does not have any special cases for the simpler cases that could be more optimal.

Other ANGLE backends seem to mostly use the buffer approach. I think it would make sense for consistency towards the pack buffer implementation that the non-pack buffer implementation would have similar perf characteristics.

The readPixels is a known slow operation and naturally recommendation is that the data would be processed with a shader. Are you working around some other WebKit issue with readPixels or is it just that readPixels should really be faster? E.g. when considering what to fix, would you benefit some other feature working better or just that readPixels would be faster?

Referenced Bugs:

[Bug 223434] WebGL2 performance problem test cases
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220110/c8f155ee/attachment.htm>

More information about the webkit-unassigned mailing list