mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Add webgpu
feature flag (#34444)
* Move script gpu files into webgpu folder Signed-off-by: atbrakhi <atbrakhi@igalia.com> * Modify gpu webidls Signed-off-by: atbrakhi <atbrakhi@igalia.com> * move gpu realted webidl Signed-off-by: atbrakhi <atbrakhi@igalia.com> * add webgpu feature to script Signed-off-by: atbrakhi <atbrakhi@igalia.com> * add dummy implementation for gpucanvascontext Signed-off-by: atbrakhi <atbrakhi@igalia.com> * fmt Signed-off-by: atbrakhi <atbrakhi@igalia.com> * add skip-if CARGO_FEATURE_WEBGPU Signed-off-by: atbrakhi <atbrakhi@igalia.com> * Move NavigatorGPU and workerNavigator GPU to webgpu idl Signed-off-by: atbrakhi <atbrakhi@igalia.com> * fmt and cleanup Signed-off-by: atbrakhi <atbrakhi@igalia.com> * review fix Signed-off-by: atbrakhi <atbrakhi@igalia.com> * enable webgpu by default and also some fmt fix Signed-off-by: atbrakhi <atbrakhi@igalia.com> * Add pref back, fix imports, small cleanups Signed-off-by: atbrakhi <atbrakhi@igalia.com> --------- Signed-off-by: atbrakhi <atbrakhi@igalia.com>
This commit is contained in:
parent
bba3bc6ac2
commit
1591a3b506
52 changed files with 295 additions and 105 deletions
|
@ -11,6 +11,9 @@ rust-version.workspace = true
|
|||
name = "script_traits"
|
||||
path = "lib.rs"
|
||||
|
||||
[features]
|
||||
webgpu = []
|
||||
|
||||
[dependencies]
|
||||
background_hang_monitor_api = { workspace = true }
|
||||
base = { workspace = true }
|
||||
|
|
|
@ -55,6 +55,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
|||
use servo_atoms::Atom;
|
||||
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||
use style_traits::{CSSPixel, SpeculativePainter};
|
||||
#[cfg(feature = "webgpu")]
|
||||
use webgpu::WebGPUMsg;
|
||||
use webrender_api::units::{DeviceIntSize, DevicePixel, LayoutPixel};
|
||||
use webrender_api::{DocumentId, ExternalScrollId, ImageKey};
|
||||
|
@ -380,6 +381,7 @@ pub enum ConstellationControlMsg {
|
|||
/// Notifies the media session about a user requested media session action.
|
||||
MediaSessionAction(PipelineId, MediaSessionActionType),
|
||||
/// Notifies script thread that WebGPU server has started
|
||||
#[cfg(feature = "webgpu")]
|
||||
SetWebGPUPort(IpcReceiver<WebGPUMsg>),
|
||||
/// The compositor scrolled and is updating the scroll states of the nodes in the given
|
||||
/// pipeline via the Constellation.
|
||||
|
@ -422,6 +424,7 @@ impl fmt::Debug for ConstellationControlMsg {
|
|||
PaintMetric(..) => "PaintMetric",
|
||||
ExitFullScreen(..) => "ExitFullScreen",
|
||||
MediaSessionAction(..) => "MediaSessionAction",
|
||||
#[cfg(feature = "webgpu")]
|
||||
SetWebGPUPort(..) => "SetWebGPUPort",
|
||||
SetScrollStates(..) => "SetScrollStates",
|
||||
SetEpochPaintTime(..) => "SetEpochPaintTime",
|
||||
|
|
|
@ -23,6 +23,7 @@ use net_traits::CoreResourceMsg;
|
|||
use serde::{Deserialize, Serialize};
|
||||
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||
use style_traits::CSSPixel;
|
||||
#[cfg(feature = "webgpu")]
|
||||
use webgpu::{wgc, WebGPU, WebGPUResponse};
|
||||
|
||||
use crate::{
|
||||
|
@ -247,12 +248,14 @@ 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),
|
||||
#[cfg(feature = "webgpu")]
|
||||
/// Create a WebGPU Adapter instance
|
||||
RequestAdapter(
|
||||
IpcSender<WebGPUResponse>,
|
||||
wgc::instance::RequestAdapterOptions,
|
||||
wgc::id::AdapterId,
|
||||
),
|
||||
#[cfg(feature = "webgpu")]
|
||||
/// Get WebGPU channel
|
||||
GetWebGPUChan(IpcSender<Option<WebGPU>>),
|
||||
/// Notify the constellation of a pipeline's document's title.
|
||||
|
@ -312,7 +315,9 @@ impl fmt::Debug for ScriptMsg {
|
|||
ForwardDOMMessage(..) => "ForwardDOMMessage",
|
||||
ScheduleJob(..) => "ScheduleJob",
|
||||
MediaSessionEvent(..) => "MediaSessionEvent",
|
||||
#[cfg(feature = "webgpu")]
|
||||
RequestAdapter(..) => "RequestAdapter",
|
||||
#[cfg(feature = "webgpu")]
|
||||
GetWebGPUChan(..) => "GetWebGPUChan",
|
||||
TitleChanged(..) => "TitleChanged",
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue