Bug 223167

Summary: WebGL should be aware of [AllowShared]
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: WebGLAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, dino, esprehn+autocc, ews-watchlist, graouts, gyuyoung.kim, hi, kbr, kkinnunen, kondapallykalyan, mehdisabwat, oleksandr.chekhovskyi, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

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. ***