Initial implementation of GPUShaderModule

Added WebIDL bindings for `GPUShaderModule`.
Implemented the `createShaderModule` function of `GPUDevice`.
This commit is contained in:
Istvan Miklos 2020-01-29 11:15:18 +01:00
parent 5f55cd5d71
commit a8621c4ed9
9 changed files with 156 additions and 17 deletions

View file

@ -98,7 +98,10 @@ use std::sync::Arc;
use time::{get_time, Timespec};
use uuid::Uuid;
use webgpu::wgpu::{
id::{AdapterId, BindGroupId, BindGroupLayoutId, BufferId, DeviceId, PipelineLayoutId},
id::{
AdapterId, BindGroupId, BindGroupLayoutId, BufferId, DeviceId, PipelineLayoutId,
ShaderModuleId,
},
Backend,
};
@ -2128,6 +2131,12 @@ impl GlobalScope {
.borrow_mut()
.create_pipeline_layout_id(backend)
}
pub fn wgpu_create_shader_module_id(&self, backend: Backend) -> ShaderModuleId {
self.gpu_id_hub
.borrow_mut()
.create_shader_module_id(backend)
}
}
fn timestamp_in_ms(time: Timespec) -> u64 {