| Summary: | "TypeError: Type error" when calling WebGL bufferData with typed array backed by growable SharedArrayBuffer | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Ian Kettlewell <Ian.kettlewell> | ||||||
| Component: | WebGL | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||
| Status: | RESOLVED DUPLICATE | ||||||||
| Severity: | Normal | CC: | dino, kbr, kkinnunen, webkit-bug-importer, ysuzuki | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | Safari Technology Preview | ||||||||
| Hardware: | Mac (Apple Silicon) | ||||||||
| OS: | macOS 13 | ||||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=248024 | ||||||||
| Bug Depends on: | 248024 | ||||||||
| Bug Blocks: | |||||||||
| Attachments: |
|
||||||||
|
Description
Ian Kettlewell
2023-01-08 21:01:07 PST
Created attachment 464416 [details]
server to run the file with
Likely regressed with bug 248024 Yusuke, it appears intentional. Is there anything WebGL code can do to opt into using the growable array buffers? (In reply to Kimmo Kinnunen from comment #2) > Likely regressed with bug 248024 > > Yusuke, it appears intentional. > Is there anything WebGL code can do to opt into using the growable array > buffers? Growable SharedArrayBuffer / Resizable ArrayBuffer cannot be used for IDL saying ArrayBuffer without [[AllowResizable]] annotation. (This is explicitly specified for resizable array-buffer / growable shared-array-buffer). https://webidl.spec.whatwg.org/#AllowResizable "If the [AllowResizable] extended attribute and the [AllowShared] extended attribute both appear on one of the buffer source types, it creates a new IDL type that allows the buffer source type to be additionally backed by an ECMAScript SharedArrayBuffer that is growable." Thus, given that WebGL IDL is not saying [[AllowResizable]], I think this behavior is expected. (bufferData does not have [[AllowResizable]]). On the other hand, > I discovered this in a game jam entry I made (https://ianjk.com/ld52/) that I was testing in the Safari Technology Preview. For some reason the SharedArrayBuffer backing the WebAssembly binary is automatically made 'growable' in Safari Technology Preview 160. In Safari 16.2 that does not happen so both the attached example and my game jam entry run fine. This is fixed in bug 249635. *** This bug has been marked as a duplicate of bug 249635 *** For what it's worth I think the WebGL IDL should be updated to add [AllowResizable] for compatibility with WebAssembly applications that use resizable memory. Have filed https://github.com/KhronosGroup/WebGL/issues/3510 about this. |