aboutsummaryrefslogtreecommitdiffstats
path: root/components/webgpu/identity.rs
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2020-07-07 14:37:42 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2020-07-16 23:21:09 +0530
commit0dc1514d573260e736e3587f352a9663bd6be93b (patch)
tree859186196c4607311b36688496cc55cafd37ec16 /components/webgpu/identity.rs
parent809b4ae2eefdbc118efc911b1d14d9a5a04eff79 (diff)
downloadservo-0dc1514d573260e736e3587f352a9663bd6be93b.tar.gz
servo-0dc1514d573260e736e3587f352a9663bd6be93b.zip
Implement Async Error reporting for WebGPU and update wgpu-core
Diffstat (limited to 'components/webgpu/identity.rs')
-rw-r--r--components/webgpu/identity.rs19
1 files changed, 17 insertions, 2 deletions
diff --git a/components/webgpu/identity.rs b/components/webgpu/identity.rs
index 9ed149eb152..a7fce80a82f 100644
--- a/components/webgpu/identity.rs
+++ b/components/webgpu/identity.rs
@@ -2,7 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
+use crate::WebGPUDevice;
use ipc_channel::ipc::IpcSender;
+use msg::constellation_msg::PipelineId;
use serde::{Deserialize, Serialize};
use wgpu::{
hub::{GlobalIdentityHandlerFactory, IdentityHandler, IdentityHandlerFactory},
@@ -14,7 +16,14 @@ use wgpu::{
};
use wgt::Backend;
-#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
+#[derive(Clone, Debug, Deserialize, Serialize)]
+pub enum WebGPUOpResult {
+ ValidationError(String),
+ OutOfMemoryError,
+ Success,
+}
+
+#[derive(Clone, Debug, Deserialize, Serialize)]
pub enum WebGPUMsg {
FreeAdapter(AdapterId),
FreeDevice(DeviceId),
@@ -32,6 +41,12 @@ pub enum WebGPUMsg {
FreeSurface(SurfaceId),
FreeShaderModule(ShaderModuleId),
FreeRenderBundle(RenderBundleId),
+ WebGPUOpResult {
+ device: WebGPUDevice,
+ scope_id: u64,
+ pipeline_id: PipelineId,
+ result: WebGPUOpResult,
+ },
Exit,
}
@@ -56,7 +71,7 @@ macro_rules! impl_identity_handler {
fn free(&self, id: $id) {
log::debug!("free {} {:?}", $st, id);
let msg = $($var)*(id);
- if self.sender.send(msg).is_err() {
+ if self.sender.send(msg.clone()).is_err() {
log::error!("Failed to send {:?}", msg);
}
}