Initial implementation of GPUDevice for WebGPU

Added the WebIDL bindigs for GPUDevice, GPUObjectDescriptorBase, GPUDeviceDescriptor, GPUObjectBase
Implemented the `requestDevice` function of `GPUAdapter`
This commit is contained in:
Istvan Miklos 2019-11-12 12:56:57 +01:00
parent 7aa68c8fe7
commit b15d2bb7d7
11 changed files with 270 additions and 16 deletions

View file

@ -26,7 +26,7 @@ use crate::dom::xr::XR;
use dom_struct::dom_struct;
use std::cell::RefCell;
use std::rc::Rc;
use webgpu::wgpu::AdapterId;
use webgpu::wgpu::{AdapterId, DeviceId};
#[dom_struct]
pub struct Navigator {
@ -76,6 +76,10 @@ impl Navigator {
pub fn create_adapter_id(&self) -> AdapterId {
self.gpu_id_hub.borrow_mut().create_adapter_id()
}
pub fn create_device_id(&self) -> DeviceId {
self.gpu_id_hub.borrow_mut().create_device_id()
}
}
impl NavigatorMethods for Navigator {