Commit Graph

4 Commits

Author SHA1 Message Date
Andrei Volykhin
65620b623d webgpu: Add the latest spec compliant GPUAdapterInfo (#39960)
According to the WebGPU specification there are some missing readonly
attributes (subgroupMinSize, subgroupMaxSize, isFallbackAdapter) for
GPUAdapterInfo IDL interface.

See https://gpuweb.github.io/gpuweb/#gpuadapterinfo

Added the new readonly attributes:
- GPUAdapter 'info' attribute
  https://gpuweb.github.io/gpuweb/#dom-gpuadapter-info
- GPUDevice 'adapterInfo' attribute
  https://gpuweb.github.io/gpuweb/#dom-gpudevice-adapterinfo

Removed marked as the deprecated the following method and attribute from
GPUAdapter interface:
- 'requestAdapterInfo' method
- 'isFallbackAdapter' attribute

Testing: Improvements in WebGPU CTS expectations
- webgpu:api,operation,adapter,info:adapter_info:*
- webgpu:api,operation,adapter,info:device_matches_adapter:*
- webgpu:api,operation,adapter,info:same_object:*
- webgpu:api,operation,adapter,info:subgroup_sizes:*
- webgpu:api,operation,adapter,requestAdapter:requestAdapter:*
- webgpu:idl,javascript:*

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-10-21 17:41:36 +00:00
Wu Yuwei
bb70c35a96 WebGPU: expose GPUObjectBase to worker (#39463)
Label attribute in several WebGPU object should be available to worker
as well.
[Firefox](https://searchfox.org/firefox-main/source/dom/webidl/WebGPU.webidl#10)
doesn't limit it to window either.

Testing: CTS [try
run](https://github.com/wusyong/servo/actions/runs/17942843000) from my
fork

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
2025-09-24 04:10:56 +00:00
Josh Matthews
bd9bb77295 script_bindings: Assert that serializable/transferable types have accurate WebIDL annotations (#38615)
These changes add compile-time assertions that:
* any type that implements the Serializable/Transferable trait has a
`[Serializable]` or `[Transferable]` annotation in the interface WebIDL
* any WebIDL interface with the `[Serializable]` or `[Transferable]`
annotation implements the corresponding trait

This is useful because it means that WebIDL definitions will be less
confusing if you're trying to figure out whether Servo supports
serializing/transferring a particular interface type. It also makes
fixing #21715 in the future a little bit easier, because the annotations
will remain up to date.

Testing: compile-time only; no point in writing tests for this since it
involves webidl codegen.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-13 08:36:04 +00:00
Josh Matthews
af8d7c2de7 script: Move code generation and webidl files to new script_bindings crate. (#35157)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-01-24 20:47:43 +00:00