Implement GPUComputePassEncoder functions

Implement the `dispatch`, `endPass`, `setBindGroup`, `setPipeline` functions of `GPUComputePassEncoder`.
This commit is contained in:
Istvan Miklos 2020-02-18 11:29:21 +01:00
parent 5597ccf57d
commit 170e9971ac
10 changed files with 109 additions and 83 deletions

View file

@ -103,6 +103,7 @@ pub enum WebGPURequest {
// wgpu::command::CommandBufferDescriptor,
),
Submit(wgpu::id::QueueId, Vec<wgpu::id::CommandBufferId>),
RunComputePass(wgpu::id::CommandEncoderId, Vec<u8>),
}
#[derive(Clone, Debug, Deserialize, Serialize)]
@ -418,6 +419,13 @@ impl WGPU {
&command_buffer_ids
));
},
WebGPURequest::RunComputePass(command_encoder_id, raw_data) => {
let global = &self.global;
gfx_select!(command_encoder_id => global.command_encoder_run_compute_pass(
command_encoder_id,
&raw_data
));
},
WebGPURequest::Exit(sender) => {
self.deinit();
if let Err(e) = sender.send(()) {