servo/components/script
bors-servo 9cd22a01f7
Auto merge of #27285 - kunalmohan:async-error, r=kvark
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. -->
2020-07-17 13:18:31 -04:00
..
docs Update doc links and code snippet for trace implementation 2020-05-03 19:03:33 +05:30
dom Auto merge of #27285 - kunalmohan:async-error, r=kvark 2020-07-17 13:18:31 -04:00
task_source
animation_timeline.rs Move most animation processing to script 2020-05-12 10:22:14 +02:00
animations.rs Auto merge of #27032 - mrobinson:fractional-iteration, r=jdm 2020-06-24 15:54:27 -04:00
body.rs fix streaming request bodies, terminate fetch if the body stream errors 2020-06-16 13:14:38 +08:00
build.rs Update error message. 2020-05-04 11:52:49 -04:00
canvas_state.rs Fix ./mach build --release --with-layout-2020 2020-06-10 22:34:24 +05:30
Cargo.toml dom: Add Window.js_backtrace debugging extension method. 2020-07-14 22:39:59 -04:00
clipboard_provider.rs
devtools.rs Report real caller information for console APIs to devtools. 2020-04-28 21:32:41 -04:00
document_loader.rs
euclidext.rs
fetch.rs Make url for "client" referrer mandatory 2020-06-17 19:07:14 +02:00
image_listener.rs Refactor ImageCache::find_image_or_metadata API. 2020-04-17 11:58:18 -04:00
init.rs
layout_image.rs Make url for "client" referrer mandatory 2020-06-17 19:07:14 +02:00
lib.rs serviceworker: make job queue unique per origin 2020-05-21 13:21:21 +08:00
mem.rs
microtask.rs ensure clean shutdown of all threads running JS 2020-06-30 13:22:38 +08:00
network_listener.rs
realms.rs
script_module.rs Use Rc instead of cloning the DOMString 2020-07-14 20:34:01 -07:00
script_runtime.rs ensure clean shutdown of all threads running JS 2020-06-30 13:22:38 +08:00
script_thread.rs Ensure GPUDevice cleanup in GlobalScope 2020-07-17 21:17:38 +05:30
serviceworker_manager.rs ensure clean shutdown of all threads running JS 2020-06-30 13:22:38 +08:00
stylesheet_loader.rs Fix invalid use of ReferrerUrl 2020-06-17 19:07:15 +02:00
stylesheet_set.rs
task.rs ensure clean shutdown of all threads running JS 2020-06-30 13:22:38 +08:00
task_manager.rs ensure clean shutdown of all threads running JS 2020-06-30 13:22:38 +08:00
task_queue.rs
test.rs
textinput.rs
timers.rs ensure clean shutdown of all threads running JS 2020-06-30 13:22:38 +08:00
unpremultiplytable.rs
webdriver_handlers.rs