From a751b1c3d7400ce7b2b8ebbeee076e3eb1a2c106 Mon Sep 17 00:00:00 2001 From: Zakor Gyula Date: Wed, 20 Nov 2019 09:03:10 +0100 Subject: Only start WebGPU thread if an adapter is requested --- components/script_traits/script_msg.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'components/script_traits/script_msg.rs') diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs index 1eccc794398..8a04b59d57d 100644 --- a/components/script_traits/script_msg.rs +++ b/components/script_traits/script_msg.rs @@ -30,10 +30,12 @@ use net_traits::storage_thread::StorageType; use net_traits::CoreResourceMsg; use servo_url::ImmutableOrigin; use servo_url::ServoUrl; +use smallvec::SmallVec; use std::collections::{HashMap, VecDeque}; use std::fmt; use style_traits::viewport::ViewportConstraints; use style_traits::CSSPixel; +use webgpu::{wgpu, WebGPUResponseResult}; use webrender_api::units::{DeviceIntPoint, DeviceIntSize}; /// A particular iframe's size, associated with a browsing context. @@ -257,6 +259,12 @@ pub enum ScriptMsg { /// Notifies the constellation about media session events /// (i.e. when there is metadata for the active media session, playback state changes...). MediaSessionEvent(PipelineId, MediaSessionEvent), + /// Create a WebGPU Adapter instance + RequestAdapter( + IpcSender, + wgpu::instance::RequestAdapterOptions, + SmallVec<[wgpu::id::AdapterId; 4]>, + ), } impl fmt::Debug for ScriptMsg { @@ -309,6 +317,7 @@ impl fmt::Debug for ScriptMsg { GetScreenSize(..) => "GetScreenSize", GetScreenAvailSize(..) => "GetScreenAvailSize", MediaSessionEvent(..) => "MediaSessionEvent", + RequestAdapter(..) => "RequestAdapter", }; write!(formatter, "ScriptMsg::{}", variant) } -- cgit v1.2.3