Initial implementation of GPUCommandEncoder

Added WebIDL bindings for `GPUCommandEncoder`, `GPUCommandBuffer`, `GPUComputePassEncoder`, `GPUProgrammablePassEncoder`.
Implemented the `beginComputePass`, `copyBufferToBuffer` and `finish` functions of `GPUCommandEncoder`.
Implemented the `createCommandEncoder` function of `GPUDevice`.
This commit is contained in:
Zakor Gyula 2020-01-14 08:54:08 +01:00 committed by Istvan Miklos
parent 9031369c19
commit 4facd3d4d2
14 changed files with 443 additions and 13 deletions

View file

@ -99,8 +99,8 @@ use time::{get_time, Timespec};
use uuid::Uuid;
use webgpu::wgpu::{
id::{
AdapterId, BindGroupId, BindGroupLayoutId, BufferId, ComputePipelineId, DeviceId,
PipelineLayoutId, ShaderModuleId,
AdapterId, BindGroupId, BindGroupLayoutId, BufferId, CommandEncoderId, ComputePipelineId,
DeviceId, PipelineLayoutId, ShaderModuleId,
},
Backend,
};
@ -2137,11 +2137,18 @@ impl GlobalScope {
.borrow_mut()
.create_shader_module_id(backend)
}
pub fn wgpu_create_compute_pipeline_id(&self, backend: Backend) -> ComputePipelineId {
self.gpu_id_hub
.borrow_mut()
.create_compute_pipeline_id(backend)
}
pub fn wgpu_create_command_encoder_id(&self, backend: Backend) -> CommandEncoderId {
self.gpu_id_hub
.borrow_mut()
.create_command_encoder_id(backend)
}
}
fn timestamp_in_ms(time: Timespec) -> u64 {