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

Myles C. Maxfield
Reported 2022-02-20 00:56:00 PST
Instead of a userdata/function pointer pair, we can just use a block.
Attachments
Patch (14.04 KB, patch)
2022-02-20 01:02 PST, Myles C. Maxfield
dino: review+
Patch for committing (22.33 KB, patch)
2022-02-21 13:49 PST, Myles C. Maxfield
no flags
Myles C. Maxfield
Comment 1 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.
Myles C. Maxfield
Comment 2 2022-02-20 01:02:28 PST
Myles C. Maxfield
Comment 3 2022-02-21 13:49:01 PST
Created attachment 452770 [details] Patch for committing
Myles C. Maxfield
Comment 4 2022-02-21 14:09:59 PST
Radar WebKit Bug Importer
Comment 5 2022-02-21 14:10:20 PST
Note You need to log in before you can comment on or make changes to this bug.