Bug 247240 - Missing WebGL2 extensions EXT_float_blend and EXT_color_buffer_float (on M1 iOS)
Summary: Missing WebGL2 extensions EXT_float_blend and EXT_color_buffer_float (on M1 iOS)
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: ANGLE (show other bugs)
Version: Safari 16
Hardware: iPhone / iPad iOS 15
: P2 Blocker
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-10-30 06:02 PDT by Andre van Kammen
Modified: 2023-05-11 01:55 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andre van Kammen 2022-10-30 06:02:52 PDT
Hello,

We are writing an application that uses the WebGL2 for handling audio.

It makes use of the Float32 buffer support (EXT_color_buffer_float) in WebGL2 and the ability to have them added with the (EXT_float_blend) function. I could write a workaround for the missing blend by having a shader do the blending, but on the M1 iPad Pro the EXT_color_buffer_float extension is also missing.

https://webglreport.com/?v=2

Can you give me an indication for when or if these extensions will be supported in Safari for iOS?

Friendly greetings,

André van Kammen
Comment 1 Kenneth Russell 2022-10-31 09:18:58 PDT
iOS only supported 16-bit floating-point render targets, at least at the time the original WebGL 2.0 support for iOS was added. Your application should be robust and fall back to the use of half-float render targets when that is what's supported:
https://registry.khronos.org/webgl/extensions/EXT_color_buffer_half_float/
Comment 2 Radar WebKit Bug Importer 2022-11-06 05:03:17 PST
<rdar://problem/102010491>
Comment 3 Andre van Kammen 2022-11-06 07:26:26 PST
Well iOs currently does support 32 bit float buffers, as was also specified on MDN which reports it's supported from Safari 15 on iOS.

https://developer.mozilla.org/en-US/docs/Web/API/EXT_color_buffer_float

I would like to have a robust application, but processing audio with half precision Float16 is not a good fallback because it would seriously impact the audio quality. Especially because the audio goes trough multiple steps including a Fourier transformation and reverse, the inaccuracy would multiply on each step.

It's the EXT_float_blend extension which I'm missing, and i can also write a workaround doing the blend in a shader.

Currently safari on iOS is the only browser not supporting this extension.

https://developer.mozilla.org/en-US/docs/Web/API/EXT_float_blend

MDN specifies it was removed, I was wondering if that was because of the Metal implementation and if it would be reimplemented in a later stage.

So will this function return? If not I will write code to handle the blend in a shader, but after your previous answer I'm getting the idea you want to remove float32 support as wel from Safari on iOS?
Comment 4 Dan Glastonbury 2022-11-06 15:33:56 PST
OpenGL & WebGL handling for floating-point formats has been a mess.

Apple family GPUs don't support blending for 128-bit RGBA32F render targets (https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf). The way the EXT_float_blend extension is written is that it enables blending for all the formats listed in EXT_color_buffer_float, including RGBA32F that these hardware families can't support. Incorrectly allowing EXT_float_blend to be enabled has resulted in bugs in WebGL applications.

A new extension would need to be proposed and adopted to allow blending for a subset of the 32-bit floating-point formats.
Comment 5 Joe Pea 2023-05-07 23:20:01 PDT
I had this problem with an iPhone 14. Not sure how to reproduce atm.
Comment 6 Kimmo Kinnunen 2023-05-11 01:55:09 PDT
Andre, thank you for the report.

Commenting in case this comes up for other people.

> the M1 iPad Pro the EXT_color_buffer_float extension is also missing.

The extension should be supported on majority of iOS devices, including the M1 iPad Pro.
Would you be able to check which iOS version are you reporting?
Currently at least iOS 16.4 and iOS beta 16.5 do report the EXT_color_buffer_float.

Note:
iOS 16.4 and earlier mistakenly report OES_texture_float_linear. This has been fixed in beta 16.5. The current iOS devices do not implement this.

Current iOS devices do not implement EXT_float_blend.

For linear texture filtering and float blending, EXT_color_buffer_half_float should be used.

Closing as already working.