webgpu: Add a webgpu_traits crate (#36320)

This breaks the `script_traits` dependency  on `webgpu`. In general, the
`traits` crates shouldn't depend on Servo non-`traits` crates. This is
necessary to move "script to constellation" messages to the
`constellation_traits` crate, making it the entire API for talking to
the
constellation. This will break a circular dependency when that happens.

Testing: Successfully building is enough of a test for this one as
it is mainly moving types around.

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 10:06:07 +02:00 committed by GitHub
parent df9efde1c3
commit 0d693114ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 640 additions and 568 deletions

20
Cargo.lock generated
View file

@ -1172,6 +1172,7 @@ dependencies = [
"stylo_traits",
"tracing",
"webgpu",
"webgpu_traits",
"webrender",
"webrender_api",
"webrender_traits",
@ -6378,6 +6379,7 @@ dependencies = [
"uuid",
"webdriver",
"webgpu",
"webgpu_traits",
"webrender_api",
"webrender_traits",
"webxr-api",
@ -6501,10 +6503,11 @@ dependencies = [
"stylo_traits",
"uuid",
"webdriver",
"webgpu",
"webgpu_traits",
"webrender_api",
"webrender_traits",
"webxr-api",
"wgpu-core",
]
[[package]]
@ -8567,6 +8570,7 @@ dependencies = [
"serde",
"servo_config",
"servo_malloc_size_of",
"webgpu_traits",
"webrender",
"webrender_api",
"webrender_traits",
@ -8574,6 +8578,20 @@ dependencies = [
"wgpu-types",
]
[[package]]
name = "webgpu_traits"
version = "0.0.1"
dependencies = [
"arrayvec",
"base",
"ipc-channel",
"serde",
"servo_malloc_size_of",
"webrender_api",
"wgpu-core",
"wgpu-types",
]
[[package]]
name = "webpki-roots"
version = "0.26.8"