script: Remove dependency on webgpu (#36332)

After #36320, `script` only depends on `webgpu` for its type aliases to
`wgpu_core` and `wgpu_types`. This change removes the dependency on
`webgpu` in favor of depending directly on the upstream crates. This
makes it so that you can change `webgpu` without recompiling `script`.

Testing: This change is covered by existing WebGPU tests and is mainly
just changing the way dependencies are accessed.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-04-04 13:52:58 +02:00 committed by GitHub
parent 1f928252e3
commit 49d48b897a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 354 additions and 348 deletions

View file

@ -7,9 +7,8 @@ use std::rc::Rc;
use dom_struct::dom_struct;
use js::jsapi::Heap;
use script_traits::ScriptMsg;
use webgpu::wgc;
use webgpu::wgt::PowerPreference;
use webgpu_traits::WebGPUAdapterResponse;
use wgpu_types::PowerPreference;
use super::wgsllanguagefeatures::WGSLLanguageFeatures;
use crate::dom::bindings::codegen::Bindings::WebGPUBinding::{
@ -69,7 +68,7 @@ impl GPUMethods<crate::DomTypeHolder> for GPU {
if script_to_constellation_chan
.send(ScriptMsg::RequestAdapter(
sender,
wgc::instance::RequestAdapterOptions {
wgpu_core::instance::RequestAdapterOptions {
power_preference,
compatible_surface: None,
force_fallback_adapter: options.forceFallbackAdapter,