Conversation
Kangz
left a comment
There was a problem hiding this comment.
LGTM in a single-queue world but onCompletion will most likely get an optional GPUSignalValue when multiqueue is added.
Co-authored-by: Corentin Wallez <corentin@wallez.net>
spec/index.bs
Outdated
|
|
||
| GPUFence createFence(optional GPUFenceDescriptor descriptor = {}); | ||
| undefined signal(GPUFence fence, GPUFenceValue signalValue); | ||
| Promise<undefined> onCompletion(); |
There was a problem hiding this comment.
@jdashg suggested maybe renaming this to something like onSignalComplete since this is no longer on a fence object where the context is clear.
I said:
Alternatively maybe we should try to make this not sound like an event handler (with the word "on" at the front).
E.g. workCompleted or something
There was a problem hiding this comment.
onWorkCompleted? I don't know if there's a naming convention for promises in WebIDL.
There was a problem hiding this comment.
As mentioned on makes it sound like an event handler. One example (more similar to our device.lost) is:
https://www.w3.org/TR/service-workers/#ref-for-dom-serviceworkercontainer-ready
but other than that most promise-returning methods are verbs, since, you know, they're methods.
|
Editors to bikeshed the onCompletion name |
This PR adds unimplemented stubs for the `distance` builtin. Issue: gpuweb#1217
This is a follow-up to #1169 which just removes the fences from the API, as requested - being a per-requisite for multi-queue landing.
Note: strictly speaking, GPUFence was introduced without much argument very early in the API. The main goal was - to match the native APIs (which have slightly different semantics there, btw), and to anticipate helping with future changes in WebGPU, such as buffer mapping and multi-queue synchronization. Well, now we have a clear idea of the API changes, since we are in the future, and it turns out we don't really need fences. So if we want them to stay, we need to argue for them being (re-) introduced. As it stands now, a single
Queue.onCompletion()replaces fences just fine, and this is what this PR does.Preview | Diff