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

@ -17,7 +17,7 @@ use crate::dom::gpucomputepassencoder::GPUComputePassEncoder;
use dom_struct::dom_struct;
use ipc_channel::ipc;
use std::collections::HashSet;
use webgpu::{wgpu::command::RawPass, WebGPU, WebGPUCommandEncoder, WebGPURequest};
use webgpu::{WebGPU, WebGPUCommandEncoder, WebGPURequest};
#[dom_struct]
pub struct GPUCommandEncoder {
@ -69,11 +69,7 @@ impl GPUCommandEncoderMethods for GPUCommandEncoder {
&self,
_descriptor: &GPUComputePassDescriptor,
) -> DomRoot<GPUComputePassEncoder> {
GPUComputePassEncoder::new(
&self.global(),
self.channel.clone(),
RawPass::new_compute(self.encoder.0),
)
GPUComputePassEncoder::new(&self.global(), self.channel.clone(), self.encoder)
}
/// https://gpuweb.github.io/gpuweb/#dom-gpucommandencoder-copybuffertobuffer