mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
prevent unconditional cloning of results
This commit is contained in:
parent
d3d006dea3
commit
85b6bbb33a
1 changed files with 9 additions and 9 deletions
|
@ -474,7 +474,7 @@ impl<'a> WGPU<'a> {
|
||||||
))
|
))
|
||||||
.map_err(|e| format!("{:?}", e))
|
.map_err(|e| format!("{:?}", e))
|
||||||
};
|
};
|
||||||
self.encoder_record_error(command_encoder_id, result.clone());
|
self.encoder_record_error(command_encoder_id, &result);
|
||||||
self.send_result(device_id, scope_id, result);
|
self.send_result(device_id, scope_id, result);
|
||||||
},
|
},
|
||||||
WebGPURequest::CopyBufferToBuffer {
|
WebGPURequest::CopyBufferToBuffer {
|
||||||
|
@ -494,7 +494,7 @@ impl<'a> WGPU<'a> {
|
||||||
destination_offset,
|
destination_offset,
|
||||||
size
|
size
|
||||||
));
|
));
|
||||||
self.encoder_record_error(command_encoder_id, result);
|
self.encoder_record_error(command_encoder_id, &result);
|
||||||
},
|
},
|
||||||
WebGPURequest::CopyBufferToTexture {
|
WebGPURequest::CopyBufferToTexture {
|
||||||
command_encoder_id,
|
command_encoder_id,
|
||||||
|
@ -509,7 +509,7 @@ impl<'a> WGPU<'a> {
|
||||||
&destination,
|
&destination,
|
||||||
©_size
|
©_size
|
||||||
));
|
));
|
||||||
self.encoder_record_error(command_encoder_id, result);
|
self.encoder_record_error(command_encoder_id, &result);
|
||||||
},
|
},
|
||||||
WebGPURequest::CopyTextureToBuffer {
|
WebGPURequest::CopyTextureToBuffer {
|
||||||
command_encoder_id,
|
command_encoder_id,
|
||||||
|
@ -524,7 +524,7 @@ impl<'a> WGPU<'a> {
|
||||||
&destination,
|
&destination,
|
||||||
©_size
|
©_size
|
||||||
));
|
));
|
||||||
self.encoder_record_error(command_encoder_id, result);
|
self.encoder_record_error(command_encoder_id, &result);
|
||||||
},
|
},
|
||||||
WebGPURequest::CopyTextureToTexture {
|
WebGPURequest::CopyTextureToTexture {
|
||||||
command_encoder_id,
|
command_encoder_id,
|
||||||
|
@ -539,7 +539,7 @@ impl<'a> WGPU<'a> {
|
||||||
&destination,
|
&destination,
|
||||||
©_size
|
©_size
|
||||||
));
|
));
|
||||||
self.encoder_record_error(command_encoder_id, result);
|
self.encoder_record_error(command_encoder_id, &result);
|
||||||
},
|
},
|
||||||
WebGPURequest::CreateBindGroup {
|
WebGPURequest::CreateBindGroup {
|
||||||
device_id,
|
device_id,
|
||||||
|
@ -982,7 +982,7 @@ impl<'a> WGPU<'a> {
|
||||||
} else {
|
} else {
|
||||||
Err(String::from("Invalid ComputePass"))
|
Err(String::from("Invalid ComputePass"))
|
||||||
};
|
};
|
||||||
self.encoder_record_error(command_encoder_id, result);
|
self.encoder_record_error(command_encoder_id, &result);
|
||||||
},
|
},
|
||||||
WebGPURequest::RunRenderPass {
|
WebGPURequest::RunRenderPass {
|
||||||
command_encoder_id,
|
command_encoder_id,
|
||||||
|
@ -997,7 +997,7 @@ impl<'a> WGPU<'a> {
|
||||||
} else {
|
} else {
|
||||||
Err(String::from("Invalid RenderPass"))
|
Err(String::from("Invalid RenderPass"))
|
||||||
};
|
};
|
||||||
self.encoder_record_error(command_encoder_id, result);
|
self.encoder_record_error(command_encoder_id, &result);
|
||||||
},
|
},
|
||||||
WebGPURequest::Submit {
|
WebGPURequest::Submit {
|
||||||
queue_id,
|
queue_id,
|
||||||
|
@ -1276,9 +1276,9 @@ impl<'a> WGPU<'a> {
|
||||||
fn encoder_record_error<U, T: std::fmt::Debug>(
|
fn encoder_record_error<U, T: std::fmt::Debug>(
|
||||||
&self,
|
&self,
|
||||||
encoder_id: id::CommandEncoderId,
|
encoder_id: id::CommandEncoderId,
|
||||||
result: Result<U, T>,
|
result: &Result<U, T>,
|
||||||
) {
|
) {
|
||||||
if let Err(e) = result {
|
if let Err(ref e) = result {
|
||||||
self.error_command_encoders
|
self.error_command_encoders
|
||||||
.borrow_mut()
|
.borrow_mut()
|
||||||
.entry(encoder_id)
|
.entry(encoder_id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue