mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Implement WebGPU ErrorScopes <!-- Please describe your changes on the following line: --> This PR covers the following- 1. update wgpu-core (Rustify `RenderPipelineDescriptor`) 2. Add initial implementation of `pushErrorScope` and `popErrorScope`. 3. Use existing `BGL` if an equivalent already exists. A brief explanation of the ErrorScope Implementation- 1. We store `HashMap<u64, ErrorScopeInfo>` in `GPUDevice`. `ErrorScopeInfo` is a new struct used to store all necessary info for an ErrorScope. 2. We simultaneously store `Vec<u64>` to keep track of the ErrorScope hierarchy. `next_scope_id` is used to get the `scope_id` for a new Scope. 3. We send the `scope_id` of top-level scope to the server in the message for an operation. The server performs the operation and sends back the scope_id with the result message (only if a scope_id was sent from the client. Otherwise no message is sent.). 4. We store a `HashMap<WebGPUDevice, Dom<GPUDevice>>` in `GlobalScope` to access them from `ScriptThread`. 5. While creating a `GPUDevice` we send the `PipelineId` of the pipeline it was created in so that when the server send the response, we can access the device from the GlobalScope of that Pipeline. 6. We generate the relevant `GPUError` in `GlobalScope`(if required) can call the necessary fn in `GPUDevice`. This implementation is pretty rough and not complete at all. Broadly the following cases aren't handled at the moment- 1. ErrorFilter is not checked when an error is captured. 2. We don't propagate an error to enclosing scope if a scope did not capture it. 3. `UncapturedErrorEvents` is not implemented. As for Equivalent BGLs we now store `Vec<(Vec<wgt::BindGroupLayoutEntry>, Dom<GPUBindGroupLayout>)>` in `GPUDevice` and compare `Vec<wgt::BindGroupLayoutEntry>` for new BGL with the existing ones and return one if it is found. Otherwise a new one is created and an entry added to the `Vec`. r?@kvark --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors <!-- Either: --> - [X] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> |
||
---|---|---|
.. | ||
allocator | ||
atoms | ||
background_hang_monitor | ||
bluetooth | ||
bluetooth_traits | ||
canvas | ||
canvas_traits | ||
compositing | ||
config | ||
config_plugins | ||
constellation | ||
debugger | ||
deny_public_fields | ||
derive_common | ||
devtools | ||
devtools_traits | ||
dom_struct | ||
domobject_derive | ||
embedder_traits | ||
fallible | ||
geometry | ||
gfx | ||
gfx_traits | ||
hashglobe | ||
jstraceable_derive | ||
layout | ||
layout_2020 | ||
layout_thread | ||
layout_thread_2020 | ||
layout_traits | ||
malloc_size_of | ||
media | ||
metrics | ||
msg | ||
net | ||
net_traits | ||
pixels | ||
profile | ||
profile_traits | ||
rand | ||
range | ||
remutex | ||
script | ||
script_layout_interface | ||
script_plugins | ||
script_traits | ||
selectors | ||
servo | ||
servo_arc | ||
size_of_test | ||
std_test_override | ||
style | ||
style_derive | ||
style_traits | ||
to_shmem | ||
to_shmem_derive | ||
url | ||
webdriver_server | ||
webgpu | ||
webrender_surfman | ||
webrender_traits |