Bug 229508

Summary: Link program fails if shader contains 0.0/0.0
Product: WebKit Reporter: Pessimistress <cxiaoji>
Component: WebGLAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: dino, kbr, kkinnunen, kpiddington
Priority: P2    
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=229439

Description Pessimistress 2021-08-25 11:50:28 PDT
Version: Safari 15.0 (Webkit 16612.1.26.1.5)

Minimal sample to reproduce:

- Open https://codepen.io/Pessimistress/pen/dyRPjOd, link program fails with message "Internal error compiling shader with Metal backend.\nPlease submit this shader, or website as a bug to https://bugs.webkit.org"
- Change `0.0 / 0.0` to `1.0 / 0.0`, renders successfully
- Either fails in Firefox or Chrome

According to https://www.khronos.org/registry/OpenGL/specs/es/3.0/GLSL_ES_Specification_3.00.pdf, section 5.9:

"Dividing by zero does not cause an exception but does result in an unspecified value."
Comment 1 Kenneth Russell 2021-08-25 13:17:56 PDT
This is probably a duplicate of Bug 229439, in which infinities / NaNs are being fixed.
Comment 2 Kimmo Kinnunen 2021-08-30 11:13:10 PDT
Thanks for the report! I think this is now fixed.

*** This bug has been marked as a duplicate of bug 229439 ***