Bug 223167 - WebGL should be aware of [AllowShared]
Summary: WebGL should be aware of [AllowShared]
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
: 173599 227117 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-03-14 16:12 PDT by Yusuke Suzuki
Modified: 2021-09-09 03:33 PDT (History)
15 users (show)

See Also:


Attachments
Patch (15.46 KB, patch)
2021-03-14 16:16 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (19.50 KB, patch)
2021-03-15 10:01 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (20.73 KB, patch)
2021-03-15 10:43 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2021-03-14 16:12:42 PDT
We should attach [AllowShared].
Comment 1 Yusuke Suzuki 2021-03-14 16:16:48 PDT
Created attachment 423136 [details]
Patch
Comment 2 Kimmo Kinnunen 2021-03-14 23:51:50 PDT
What does it do?
Comment 3 Yusuke Suzuki 2021-03-15 10:01:27 PDT
Created attachment 423190 [details]
Patch
Comment 4 Yusuke Suzuki 2021-03-15 10:02:54 PDT
(In reply to Kimmo Kinnunen from comment #2)
> What does it do?

Attaching [AllowShared] annotations to WebGL types to align them to the spec.
This [AllowShared] annotation allows these WebGL functions to accept ArrayBuffer / ArrayBufferView created from SharedArrayBuffer. By default, non-allow-shared ArrayBuffer etc. is rejected and throws TypeError. But when [AllowShared] annotation is attached, IDL can accept them.
Comment 5 Yusuke Suzuki 2021-03-15 10:05:24 PDT
We found that this is used in apps using wasm-threads and WebGL. https://twitter.com/Constellation/status/1371507429683302403
Comment 6 Yusuke Suzuki 2021-03-15 10:43:44 PDT
Created attachment 423198 [details]
Patch
Comment 7 Kimmo Kinnunen 2021-03-15 12:51:52 PDT
Thanks, had missed the feature.
Looks good to me.
We don't have the tests for these, I'm in process of importing new set of tests from WebGL conformance test suite that should then add some test coverage.
Comment 8 Saam Barati 2021-03-15 13:18:36 PDT
Comment on attachment 423198 [details]
Patch

rs=me
Comment 9 Yusuke Suzuki 2021-03-15 13:21:42 PDT
(In reply to Kimmo Kinnunen from comment #7)
> Thanks, had missed the feature.
> Looks good to me.
> We don't have the tests for these, I'm in process of importing new set of
> tests from WebGL conformance test suite that should then add some test
> coverage.

Thanks! The added test LayoutTests/webgl/webgl-allow-shared.html covers it too :)
Comment 10 EWS 2021-03-15 13:50:00 PDT
Committed r274438: <https://commits.webkit.org/r274438>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 423198 [details].
Comment 11 Radar WebKit Bug Importer 2021-03-15 13:51:17 PDT
<rdar://problem/75445318>
Comment 12 Kenneth Russell 2021-06-21 17:42:19 PDT
*** Bug 227117 has been marked as a duplicate of this bug. ***
Comment 13 Yusuke Suzuki 2021-09-09 03:33:48 PDT
*** Bug 173599 has been marked as a duplicate of this bug. ***