You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tracking issue: synchronous exceptions in JS API #225
I'll attempt to make a complete list of entrypoints that have synchronous exceptions in the JS API:
All cases where you try to use a feature that's not enabled on the device that would throw a TypeError on a browser that hasn't implemented the feature at all (see spec)
Using an enum value introduced by the feature (e.g. query type "timestamp")
Calling a method introduced by the feature (e.g. writeTimestamp)
external image stuff (copyExternalImageToTexture/importExternalTexture) (not in C API yet, ExternalTexture in WASM #232):
"origin-clean" and "check the usability" of external image sources
copyExternalImageToTexture source image size check (can be checked in the bindings beforehand so it’s possible to know what the error is, except maybe for HTMLVideoElement because it’s weird and frames advance in the background)
writeBuffer: size alignment. Maybe this should be a validation error in the upstream spec?
Errors about the size of a source BufferSource in writeBuffer/writeTexture/setBindGroup
(EDIT 2024-10-18) Invalid formats for configure() - this was recently moved from device timeline to content timeline in the JS spec.
One approach we've been taking for some entrypoints is to say "return a generic error code, with implementation-defined logging" (eventually we're likely to make it well-defined, with a log callback on the instance):
I handled that in #377 by making it also a device error in webgpu.h (same as for formats not supported by the surface, and formats not supported by the device)
Activity
kainino0x commentedon Sep 7, 2023
Note this is in addition to synchronous errors from the C API that don't exist in the JS API (like #115).
kainino0x commentedon Dec 15, 2023
Dec 14 meeting:
kainino0x commentedon Dec 15, 2023
Marking "has resolution", we can figure out #232 when we get to it
Add and document many synchronous error statuses
Add and document many synchronous error statuses
Add and document many synchronous error statuses
Add and document many synchronous error statuses
kainino0x commentedon Oct 19, 2024
One new addition:
kainino0x commentedon Oct 19, 2024
I handled that in #377 by making it also a device error in webgpu.h (same as for formats not supported by the surface, and formats not supported by the device)