mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #27480 - kunalmohan:gpu-void-error, r=kvark
WebGPU-Report errors in Promise or void returning operations <!-- Please describe your changes on the following line: --> This also updates GPUBuffer mapping to match latest spec. r?@kvark --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
549179bbd6
22 changed files with 489 additions and 305 deletions
|
@ -5,8 +5,7 @@
|
|||
// https://gpuweb.github.io/gpuweb/#gpu-interface
|
||||
[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"]
|
||||
interface GPU {
|
||||
// May reject with DOMException // TODO: DOMException("OperationError")?
|
||||
Promise<GPUAdapter> requestAdapter(optional GPURequestAdapterOptions options = {});
|
||||
Promise<GPUAdapter?> requestAdapter(optional GPURequestAdapterOptions options = {});
|
||||
};
|
||||
|
||||
// https://gpuweb.github.io/gpuweb/#dictdef-gpurequestadapteroptions
|
||||
|
|
|
@ -9,8 +9,7 @@ interface GPUAdapter {
|
|||
readonly attribute object extensions;
|
||||
//readonly attribute GPULimits limits; Don’t expose higher limits for now.
|
||||
|
||||
// May reject with DOMException // TODO: DOMException("OperationError")?
|
||||
Promise<GPUDevice> requestDevice(optional GPUDeviceDescriptor descriptor = {});
|
||||
Promise<GPUDevice?> requestDevice(optional GPUDeviceDescriptor descriptor = {});
|
||||
};
|
||||
|
||||
dictionary GPUDeviceDescriptor : GPUObjectDescriptorBase {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
// https://gpuweb.github.io/gpuweb/#gpubuffer
|
||||
[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"]
|
||||
interface GPUBuffer {
|
||||
Promise<void> mapAsync(GPUMapModeFlags mode, optional GPUSize64 offset = 0, optional GPUSize64 size = 0);
|
||||
[Throws] ArrayBuffer getMappedRange(optional GPUSize64 offset = 0, optional GPUSize64 size = 0);
|
||||
Promise<void> mapAsync(GPUMapModeFlags mode, optional GPUSize64 offset = 0, optional GPUSize64 size);
|
||||
[Throws] ArrayBuffer getMappedRange(optional GPUSize64 offset = 0, optional GPUSize64 size);
|
||||
void unmap();
|
||||
|
||||
void destroy();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue