aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/gpuqueue.rs
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2020-08-03 01:45:29 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2020-08-03 01:45:29 +0530
commitce6e09a3aa3b9ef20dcc8f1ff5712f7a2691aa27 (patch)
tree4633a1ec77c6bad1c6fe6f0e46ebd9e5bb783aee /components/script/dom/gpuqueue.rs
parent8eff1d74de989f837eb54e80fb7296a98ef3220b (diff)
downloadservo-ce6e09a3aa3b9ef20dcc8f1ff5712f7a2691aa27.tar.gz
servo-ce6e09a3aa3b9ef20dcc8f1ff5712f7a2691aa27.zip
Change ErrorScopeId type to NonZeroU64
And extract it from WebGPURequest
Diffstat (limited to 'components/script/dom/gpuqueue.rs')
-rw-r--r--components/script/dom/gpuqueue.rs44
1 files changed, 25 insertions, 19 deletions
diff --git a/components/script/dom/gpuqueue.rs b/components/script/dom/gpuqueue.rs
index d5c742555c7..e0a1fa2e7e8 100644
--- a/components/script/dom/gpuqueue.rs
+++ b/components/script/dom/gpuqueue.rs
@@ -88,11 +88,13 @@ impl GPUQueueMethods for GPUQueue {
let command_buffers = command_buffers.iter().map(|cb| cb.id().0).collect();
self.channel
.0
- .send(WebGPURequest::Submit {
- queue_id: self.queue.0,
+ .send((
scope_id,
- command_buffers,
- })
+ WebGPURequest::Submit {
+ queue_id: self.queue.0,
+ command_buffers,
+ },
+ ))
.unwrap();
}
@@ -124,13 +126,15 @@ impl GPUQueueMethods for GPUQueue {
let final_data = IpcSharedMemory::from_bytes(
&bytes[data_offset as usize..(data_offset + content_size) as usize],
);
- if let Err(e) = self.channel.0.send(WebGPURequest::WriteBuffer {
- queue_id: self.queue.0,
- scope_id: self.device.borrow().as_ref().unwrap().use_current_scope(),
- buffer_id: buffer.id().0,
- buffer_offset,
- data: final_data,
- }) {
+ if let Err(e) = self.channel.0.send((
+ self.device.borrow().as_ref().unwrap().use_current_scope(),
+ WebGPURequest::WriteBuffer {
+ queue_id: self.queue.0,
+ buffer_id: buffer.id().0,
+ buffer_offset,
+ data: final_data,
+ },
+ )) {
warn!("Failed to send WriteBuffer({:?}) ({})", buffer.id(), e);
return Err(Error::Operation);
}
@@ -158,14 +162,16 @@ impl GPUQueueMethods for GPUQueue {
let write_size = convert_texture_size_to_wgt(&convert_texture_size_to_dict(&size));
let final_data = IpcSharedMemory::from_bytes(&bytes);
- if let Err(e) = self.channel.0.send(WebGPURequest::WriteTexture {
- queue_id: self.queue.0,
- scope_id: self.device.borrow().as_ref().unwrap().use_current_scope(),
- texture_cv,
- data_layout: texture_layout,
- size: write_size,
- data: final_data,
- }) {
+ if let Err(e) = self.channel.0.send((
+ self.device.borrow().as_ref().unwrap().use_current_scope(),
+ WebGPURequest::WriteTexture {
+ queue_id: self.queue.0,
+ texture_cv,
+ data_layout: texture_layout,
+ size: write_size,
+ data: final_data,
+ },
+ )) {
warn!(
"Failed to send WriteTexture({:?}) ({})",
destination.texture.id().0,