Bug 264404

Summary: REGRESSION (iOS 17): black screen when rendering to / reading from float buffer
Product: WebKit Reporter: Roberto Ranon <roberto.ranon>
Component: WebGLAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: dino, kbr, kkinnunen, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 17   
Hardware: iPhone / iPad   
OS: iOS 17   

Description Roberto Ranon 2023-11-08 06:52:09 PST
iOS 17 has likely introduced some regression in WebGL which has to do with float textures.

Specifically, this three.js example

https://threejs.org/examples/?q=float#webgl_read_float_buffer

produces a black screen on iOS 17 / iPad OS 17 17.03 (tested on iPhone 13 mini, iPad PRO M1, and also on browser stack, with a few devices), while it works OK on iOS 16.

More specifically, the example renders to a float buffer, and then reads back it as a texture in a second pass.
I've had other similar behaviours in other libraries using float textures; half_float textures, instead, seem ok (in the three.js example above, if you change the buffer to half_float, it works).
Comment 1 Radar WebKit Bug Importer 2023-11-08 14:23:38 PST
<rdar://problem/118139428>
Comment 2 Kimmo Kinnunen 2023-11-09 01:26:20 PST
Thank you for the report.
Unfortunately iOS 16 advertises OES_texture_float_linear incorrectly.

The OES_texture_float_linear extension is part of the WebGL API and allows linear filtering with floating-point pixel types for textures.

Float textures are not filterable on iOS, and as such the rendering is not defined on iOS.

The bug is fixed on iOS 17. The threejs example could be improved to check for the extension, and the extension check should fail on iOS 17. The example could show an error to the user. Alternatively filtering could be turned off. Currently the example has one dimension of the texture using GL_LINEAR.

Half float textures work on iOS: https://registry.khronos.org/webgl/extensions/OES_texture_half_float/

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