aboutsummaryrefslogtreecommitdiffstats
path: root/components/webgpu/lib.rs
diff options
context:
space:
mode:
authorSamson <16504129+sagudev@users.noreply.github.com>2024-05-22 18:47:35 +0200
committerGitHub <noreply@github.com>2024-05-22 16:47:35 +0000
commit794110ebe58ad72d809291e9feb3f2cc92819941 (patch)
tree9c01451fa022f433fa8a305d58c2a79da747e838 /components/webgpu/lib.rs
parent9f32809671c8c8e79d59c95194dcc466452299fc (diff)
downloadservo-794110ebe58ad72d809291e9feb3f2cc92819941.tar.gz
servo-794110ebe58ad72d809291e9feb3f2cc92819941.zip
webgpu: Move errorscopes to WGPU thread (#32304)
* Prepare errorscopes logic in wgpu_thread * remove scope_id from ipc * new GPUErrors per spec * remove cotent timeline error_scope * fixup poperrorscope types * device_scope -> gpu_error and nice errors * Handle errors detection more elegantly * good expectations * new expectations * Make error_scope.errors Vec as per spec
Diffstat (limited to 'components/webgpu/lib.rs')
-rw-r--r--components/webgpu/lib.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/components/webgpu/lib.rs b/components/webgpu/lib.rs
index 2006e9a477b..d3fc3068b97 100644
--- a/components/webgpu/lib.rs
+++ b/components/webgpu/lib.rs
@@ -13,11 +13,11 @@ mod wgpu_thread;
use std::borrow::Cow;
use std::collections::HashMap;
-use std::num::NonZeroU64;
use std::sync::{Arc, Mutex};
use arrayvec::ArrayVec;
use euclid::default::Size2D;
+pub use gpu_error::{Error, ErrorFilter, PopError};
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use serde::{Deserialize, Serialize};
use servo_config::pref;
@@ -28,16 +28,15 @@ use webrender_traits::{
use wgc::id;
mod dom_messages;
+mod gpu_error;
mod script_messages;
pub use dom_messages::*;
pub use identity::*;
pub use script_messages::*;
-
-pub type ErrorScopeId = NonZeroU64;
pub use wgpu_thread::PRESENTATION_BUFFER_COUNT;
#[derive(Clone, Debug, Deserialize, Serialize)]
-pub struct WebGPU(pub IpcSender<(Option<ErrorScopeId>, WebGPURequest)>);
+pub struct WebGPU(pub IpcSender<WebGPURequest>);
impl WebGPU {
pub fn new(
@@ -95,7 +94,7 @@ impl WebGPU {
pub fn exit(&self, sender: IpcSender<()>) -> Result<(), &'static str> {
self.0
- .send((None, WebGPURequest::Exit(sender)))
+ .send(WebGPURequest::Exit(sender))
.map_err(|_| "Failed to send Exit message")
}
}