Bug 236934

Summary: [WebGPU] Tracer bullet part 12: Add block-based callbacks in addition to C function pointer callbacks
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: WebGPUAssignee: Myles C. Maxfield <mmaxfield>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 236879, 236935    
Attachments:
Description Flags
Patch
dino: review+
Patch for committing none

Description Myles C. Maxfield 2022-02-20 00:56:00 PST
Instead of a userdata/function pointer pair, we can just use a block.
Comment 1 Myles C. Maxfield 2022-02-20 00:57:45 PST
It turns out we can't actually use this just yet because blocks have to be copyable, which means any lambdas we convert to blocks have to be copyable, but in the GPU Process we receive a CompletionHandler to call back with a reply, but CompletionHandlers are not copyable, so we can't construct the block to pass in to WebGPU.framework.
Comment 2 Myles C. Maxfield 2022-02-20 01:02:28 PST
Created attachment 452684 [details]
Patch
Comment 3 Myles C. Maxfield 2022-02-21 13:49:01 PST
Created attachment 452770 [details]
Patch for committing
Comment 4 Myles C. Maxfield 2022-02-21 14:09:59 PST
Committed r290270 (247595@trunk): <https://commits.webkit.org/247595@trunk>
Comment 5 Radar WebKit Bug Importer 2022-02-21 14:10:20 PST
<rdar://problem/89255880>