Auto merge of #25744 - szeged:wgpu_queue, r=jdm

Initial implementation of GPUQueue

Added WebIDL bindings for `GPUQueue`.
Implemented the `submit` function of `GPUQueue` and `defaultQueue` function of `GPUDevice`.

<!-- Please describe your changes on the following line: -->

---
<!-- 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
- [x] These changes addresses a part of #24706

<!-- Either: -->
cc @kvark @jdm @zakorgy

<!-- 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:
bors-servo 2020-02-14 15:48:40 -05:00 committed by GitHub
commit 993a5f6bec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 181 additions and 16 deletions

View file

@ -5,13 +5,14 @@
// https://gpuweb.github.io/gpuweb/#gpudevice
[Exposed=(Window, DedicatedWorker)/*, Serializable */, Pref="dom.webgpu.enabled"]
interface GPUDevice : EventTarget {
readonly attribute GPUAdapter adapter;
/*[SameObject]*/ readonly attribute GPUAdapter adapter;
readonly attribute object extensions;
readonly attribute object limits;
[SameObject] readonly attribute GPUQueue defaultQueue;
GPUBuffer createBuffer(GPUBufferDescriptor descriptor);
GPUMappedBuffer createBufferMapped(GPUBufferDescriptor descriptor);
// Promise<GPUMappedBuffer> createBufferMappedAsync(GPUBufferDescriptor descriptor);
// GPUTexture createTexture(GPUTextureDescriptor descriptor);
// GPUSampler createSampler(optional GPUSamplerDescriptor descriptor = {});
@ -25,8 +26,6 @@ interface GPUDevice : EventTarget {
GPUCommandEncoder createCommandEncoder(optional GPUCommandEncoderDescriptor descriptor = {});
// GPURenderBundleEncoder createRenderBundleEncoder(GPURenderBundleEncoderDescriptor descriptor);
// GPUQueue getQueue();
};
GPUDevice includes GPUObjectBase;

View file

@ -0,0 +1,18 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://gpuweb.github.io/gpuweb/#gpuqueue
[Exposed=(Window, DedicatedWorker), Serializable, Pref="dom.webgpu.enabled"]
interface GPUQueue {
void submit(sequence<GPUCommandBuffer> commandBuffers);
// GPUFence createFence(optional GPUFenceDescriptor descriptor = {});
// void signal(GPUFence fence, unsigned long long signalValue);
// void copyImageBitmapToTexture(
// GPUImageBitmapCopyView source,
// GPUTextureCopyView destination,
// GPUExtent3D copySize);
};
GPUQueue includes GPUObjectBase;