Bug 183321 - texImage2D with HALF_FLOAT_OES doesn't work on iOS
Summary: texImage2D with HALF_FLOAT_OES doesn't work on iOS
Status: RESOLVED DUPLICATE of bug 169999
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: Safari 11
Hardware: Unspecified iOS 11
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2018-03-04 09:43 PST by nkronlage
Modified: 2019-10-17 18:31 PDT (History)
7 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description nkronlage 2018-03-04 09:43:19 PST
Steps to Reproduce:
Go to the page https://jsfiddle.net/b1pgLwwn/ on an iOS device.  
Attach the device to a Mac and debug the page in Safari.
Press the 'Run' button in the jsfiddle

Expected Results:
No errors.  The texture should be filled with the Uint16Array data.

Actual Results:
You get the following error:  

WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
Comment 1 jonobr1 2018-05-08 10:43:39 PDT
I get this error as well
Comment 2 jonobr1 2018-05-08 10:45:03 PDT
I found this behavior as well when developing http://cornelius.patatap.com/ • iOS refused both float32Array for Floating Point Textures as well as the Half Float Type described by nkronlage@
Comment 3 jonobr1 2018-10-21 23:44:56 PDT
The jsfiddle still throws an error on Safari 12 on my iPad.
Comment 4 Radar WebKit Bug Importer 2018-10-23 14:42:44 PDT
Comment 5 jujjyl 2019-08-07 08:03:26 PDT
Unity3D engine runs into this issue as well.

Safari 8 - Safari 12 are affected.

Tested as a workaround to use GL.texImage2D(..., null); to create an uninitialized texture, but then immediately afterwards using GL.texSubImage2D(..., /*type=*/0x8d61/*GL_HALF_FLOAT_OES*/, uint16Array); to upload the content, but unfortunately that fails too, i.e. GL.texSubImage2D() neither allows passing a half-float array.

Also tried a workaround to pass a Float32Array, or a Float64Array instead of a Uint16Array, wishfully thinking that perhaps the error message would be wrong, and half-float textures could be populated by submitting another array type instead, but that does not work either.

As result, Unity3D support of half-float textures is disabled, which prevents Safari from running new Unity3D content, which utilize half-floats.
Comment 6 jujjyl 2019-08-07 08:12:22 PDT
To be more precise, it looks like the issue affects both iOS and macOS systems (not just iOS).
Comment 7 Dean Jackson 2019-10-17 18:31:59 PDT
WIll be fixed by https://bugs.webkit.org/show_bug.cgi?id=169999

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