aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/gpucomputepassencoder.rs
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2020-07-22 17:52:49 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2020-07-24 12:45:23 +0530
commitaff22db33ff237e0fd677671851e3919007f20ef (patch)
treeb3073acf157f99a004c53d33d7da3d839e5accd1 /components/script/dom/gpucomputepassencoder.rs
parent75abccb16bc19eb375ce73f26a0234e3d2ecbb9b (diff)
downloadservo-aff22db33ff237e0fd677671851e3919007f20ef.tar.gz
servo-aff22db33ff237e0fd677671851e3919007f20ef.zip
Implement GPURenderBundleEncoder and GPURenderBundle
Diffstat (limited to 'components/script/dom/gpucomputepassencoder.rs')
-rw-r--r--components/script/dom/gpucomputepassencoder.rs19
1 files changed, 14 insertions, 5 deletions
diff --git a/components/script/dom/gpucomputepassencoder.rs b/components/script/dom/gpucomputepassencoder.rs
index 2f4535d835e..1cfcdf7a25c 100644
--- a/components/script/dom/gpucomputepassencoder.rs
+++ b/components/script/dom/gpucomputepassencoder.rs
@@ -30,19 +30,28 @@ pub struct GPUComputePassEncoder {
}
impl GPUComputePassEncoder {
- fn new_inherited(channel: WebGPU, parent: &GPUCommandEncoder) -> Self {
+ fn new_inherited(
+ channel: WebGPU,
+ parent: &GPUCommandEncoder,
+ label: Option<USVString>,
+ ) -> Self {
Self {
channel,
reflector_: Reflector::new(),
- label: DomRefCell::new(None),
+ label: DomRefCell::new(label),
compute_pass: DomRefCell::new(Some(ComputePass::new(parent.id().0))),
command_encoder: Dom::from_ref(parent),
}
}
- pub fn new(global: &GlobalScope, channel: WebGPU, parent: &GPUCommandEncoder) -> DomRoot<Self> {
+ pub fn new(
+ global: &GlobalScope,
+ channel: WebGPU,
+ parent: &GPUCommandEncoder,
+ label: Option<USVString>,
+ ) -> DomRoot<Self> {
reflect_dom_object(
- Box::new(GPUComputePassEncoder::new_inherited(channel, parent)),
+ Box::new(GPUComputePassEncoder::new_inherited(channel, parent, label)),
global,
)
}
@@ -86,7 +95,7 @@ impl GPUComputePassEncoderMethods for GPUComputePassEncoder {
command_encoder_id: self.command_encoder.id().0,
compute_pass,
})
- .unwrap();
+ .expect("Failed to send RunComputePass");
self.command_encoder.set_state(
GPUCommandEncoderState::Open,