Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upInitial implementation of GPUDevice for WebGPU #25029
Conversation
highfive
commented
Dec 3, 2019
|
Heads up! This PR modifies the following files:
|
highfive
commented
Dec 3, 2019
| @@ -77,6 +83,7 @@ struct WGPU { | |||
| adapters: Vec<WebGPUAdapter>, | |||
| // Track invalid adapters https://gpuweb.github.io/gpuweb/#invalid | |||
| _invalid_adapters: Vec<WebGPUAdapter>, | |||
| device_to_adapter: HashMap<WebGPUDevice, WebGPUAdapter>, | |||
This comment has been minimized.
This comment has been minimized.
kvark
Dec 3, 2019
Member
do we need this map?
it seems like we should just carry a JS reference to WebGPUAdapter from the device struct
This comment has been minimized.
This comment has been minimized.
imiklos
Dec 4, 2019
Author
Contributor
We don't use it right now. I will remove this map. The reference to the Adapter is already in place. I will update the pull request with this change. Thank you!
| } | ||
|
|
||
| impl GPUDevice { | ||
| pub fn new_inherited( |
This comment has been minimized.
This comment has been minimized.
| &self.global(), | ||
| &self, | ||
| Heap::default(), | ||
| Heap::default(), |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
|
||
| // https://gpuweb.github.io/gpuweb/#gpudevice | ||
| [Exposed=(Window, DedicatedWorker)/*, Serializable */] |
This comment has been minimized.
This comment has been minimized.
| fn RequestDevice(&self, descriptor: &GPUDeviceDescriptor, comp: InCompartment) -> Rc<Promise> { | ||
| let promise = Promise::new_in_current_compartment(&self.global(), comp); | ||
| let sender = response_async(&promise, self); | ||
| let id = self.global().as_window().Navigator().create_device_id(); |
This comment has been minimized.
This comment has been minimized.
CYBAI
Dec 5, 2019
Collaborator
I just noticed that GPUAdapter is possibly exposed to DedicatedWorker.
Maybe we should call these window methods inside a if let instead
Ex.
if let Some(window) = self.global().downcast::<Window>() {
let id = window.Navigator().create_device_id();
...
}
This comment has been minimized.
This comment has been minimized.
Added the WebIDL bindigs for GPUDevice, GPUObjectDescriptorBase, GPUDeviceDescriptor, GPUObjectBase Implemented the `requestDevice` function of `GPUAdapter`
|
@bors-servo r+ |
|
|
Initial implementation of GPUDevice for WebGPU Added the WebIDL bindigs for GPUDevice, GPUObjectDescriptorBase, GPUDeviceDescriptor, GPUObjectBase Implemented the `requestDevice` function of `GPUAdapter` <!-- 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 cc @jdm, @kvark, @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. -->
|
|
|
@jdm error looks unrelated to the PR (android release font linking) |
|
@bors-servo retry |
Initial implementation of GPUDevice for WebGPU Added the WebIDL bindigs for GPUDevice, GPUObjectDescriptorBase, GPUDeviceDescriptor, GPUObjectBase Implemented the `requestDevice` function of `GPUAdapter` <!-- 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 cc @jdm, @kvark, @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. -->
|
|
|
@bors-servo retry
|
Initial implementation of GPUDevice for WebGPU Added the WebIDL bindigs for GPUDevice, GPUObjectDescriptorBase, GPUDeviceDescriptor, GPUObjectBase Implemented the `requestDevice` function of `GPUAdapter` <!-- 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 cc @jdm, @kvark, @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. -->
|
|
|
@bors-servo retry |
Initial implementation of GPUDevice for WebGPU Added the WebIDL bindigs for GPUDevice, GPUObjectDescriptorBase, GPUDeviceDescriptor, GPUObjectBase Implemented the `requestDevice` function of `GPUAdapter` <!-- 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 cc @jdm, @kvark, @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. -->
|
|
imiklos commentedDec 3, 2019
Added the WebIDL bindigs for GPUDevice, GPUObjectDescriptorBase, GPUDeviceDescriptor, GPUObjectBase
Implemented the
requestDevicefunction ofGPUAdapter./mach build -ddoes not report any errors./mach test-tidydoes not report any errorscc @jdm, @kvark, @zakorgy