aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/gpucommandencoder.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/gpucommandencoder.rs')
-rw-r--r--components/script/dom/gpucommandencoder.rs90
1 files changed, 53 insertions, 37 deletions
diff --git a/components/script/dom/gpucommandencoder.rs b/components/script/dom/gpucommandencoder.rs
index 6e3b01787f8..9fabd77a6fa 100644
--- a/components/script/dom/gpucommandencoder.rs
+++ b/components/script/dom/gpucommandencoder.rs
@@ -277,16 +277,18 @@ impl GPUCommandEncoderMethods for GPUCommandEncoder {
.insert(DomRoot::from_ref(destination));
self.channel
.0
- .send(WebGPURequest::CopyBufferToBuffer {
- command_encoder_id: self.encoder.0,
- device_id: self.device.id().0,
+ .send((
scope_id,
- source_id: source.id().0,
- source_offset,
- destination_id: destination.id().0,
- destination_offset,
- size,
- })
+ WebGPURequest::CopyBufferToBuffer {
+ command_encoder_id: self.encoder.0,
+ device_id: self.device.id().0,
+ source_id: source.id().0,
+ source_offset,
+ destination_id: destination.id().0,
+ destination_offset,
+ size,
+ },
+ ))
.expect("Failed to send CopyBufferToBuffer");
}
@@ -317,14 +319,18 @@ impl GPUCommandEncoderMethods for GPUCommandEncoder {
self.channel
.0
- .send(WebGPURequest::CopyBufferToTexture {
- command_encoder_id: self.encoder.0,
- device_id: self.device.id().0,
+ .send((
scope_id,
- source: convert_buffer_cv(source),
- destination: convert_texture_cv(destination),
- copy_size: convert_texture_size_to_wgt(&convert_texture_size_to_dict(&copy_size)),
- })
+ WebGPURequest::CopyBufferToTexture {
+ command_encoder_id: self.encoder.0,
+ device_id: self.device.id().0,
+ source: convert_buffer_cv(source),
+ destination: convert_texture_cv(destination),
+ copy_size: convert_texture_size_to_wgt(&convert_texture_size_to_dict(
+ &copy_size,
+ )),
+ },
+ ))
.expect("Failed to send CopyBufferToTexture");
}
@@ -355,14 +361,18 @@ impl GPUCommandEncoderMethods for GPUCommandEncoder {
self.channel
.0
- .send(WebGPURequest::CopyTextureToBuffer {
- command_encoder_id: self.encoder.0,
- device_id: self.device.id().0,
+ .send((
scope_id,
- source: convert_texture_cv(source),
- destination: convert_buffer_cv(destination),
- copy_size: convert_texture_size_to_wgt(&convert_texture_size_to_dict(&copy_size)),
- })
+ WebGPURequest::CopyTextureToBuffer {
+ command_encoder_id: self.encoder.0,
+ device_id: self.device.id().0,
+ source: convert_texture_cv(source),
+ destination: convert_buffer_cv(destination),
+ copy_size: convert_texture_size_to_wgt(&convert_texture_size_to_dict(
+ &copy_size,
+ )),
+ },
+ ))
.expect("Failed to send CopyTextureToBuffer");
}
@@ -389,14 +399,18 @@ impl GPUCommandEncoderMethods for GPUCommandEncoder {
self.channel
.0
- .send(WebGPURequest::CopyTextureToTexture {
- command_encoder_id: self.encoder.0,
- device_id: self.device.id().0,
+ .send((
scope_id,
- source: convert_texture_cv(source),
- destination: convert_texture_cv(destination),
- copy_size: convert_texture_size_to_wgt(&convert_texture_size_to_dict(&copy_size)),
- })
+ WebGPURequest::CopyTextureToTexture {
+ command_encoder_id: self.encoder.0,
+ device_id: self.device.id().0,
+ source: convert_texture_cv(source),
+ destination: convert_texture_cv(destination),
+ copy_size: convert_texture_size_to_wgt(&convert_texture_size_to_dict(
+ &copy_size,
+ )),
+ },
+ ))
.expect("Failed to send CopyTextureToTexture");
}
@@ -404,13 +418,15 @@ impl GPUCommandEncoderMethods for GPUCommandEncoder {
fn Finish(&self, descriptor: &GPUCommandBufferDescriptor) -> DomRoot<GPUCommandBuffer> {
self.channel
.0
- .send(WebGPURequest::CommandEncoderFinish {
- command_encoder_id: self.encoder.0,
- device_id: self.device.id().0,
- scope_id: self.device.use_current_scope(),
- // TODO(zakorgy): We should use `_descriptor` here after it's not empty
- // and the underlying wgpu-core struct is serializable
- })
+ .send((
+ self.device.use_current_scope(),
+ WebGPURequest::CommandEncoderFinish {
+ command_encoder_id: self.encoder.0,
+ device_id: self.device.id().0,
+ // TODO(zakorgy): We should use `_descriptor` here after it's not empty
+ // and the underlying wgpu-core struct is serializable
+ },
+ ))
.expect("Failed to send Finish");
*self.state.borrow_mut() = GPUCommandEncoderState::Closed;