[Webkit-unassigned] [Bug 237434] Precision issue in in Vertex Shader on iPads/M1 (but work on Intel Mac)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 18 23:01:26 PST 2023


https://bugs.webkit.org/show_bug.cgi?id=237434

--- Comment #15 from Kenneth Russell <kbr at google.com> ---
In Chromium with ANGLE's Metal backend, force-disabling fast math here:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/angle/src/libANGLE/renderer/metal/mtl_utils.mm;l=907?q=mtl_utils.mm

fixes most of the test failures in:

- Demo: https://fp64-arithmetic.donmccurdy.com/
- Code: https://github.com/donmccurdy/fp64-arithmetic

I didn't study the generated shaders to see whether the "invariant" keyword is being applied broadly enough to prevent all of the intermediate expressions from being optimized by the Metal shader compiler. It looks like the math operations in this FP64 emulation are highly sensitive to shader compiler optimizations.

Currently there's no global way to force-disable the use of fast math, and fast math is required for acceptable performance of shaders in general. If you find it's not possible or feasible to use "invariant" to get the needed results, we could consider adding a #pragma to the shading language, an API extension to disable fast-math optimization for shaders/programs, or something similar.

-- 
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/20231219/bd8eccdc/attachment.htm>


More information about the webkit-unassigned mailing list