mirror of
https://github.com/servo/servo.git
synced 2025-06-17 04:44:28 +00: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. --> |
||
---|---|---|
.. | ||
docs | ||
dom | ||
task_source | ||
animation_timeline.rs | ||
animations.rs | ||
body.rs | ||
build.rs | ||
canvas_state.rs | ||
Cargo.toml | ||
clipboard_provider.rs | ||
devtools.rs | ||
document_loader.rs | ||
euclidext.rs | ||
fetch.rs | ||
image_listener.rs | ||
init.rs | ||
layout_image.rs | ||
lib.rs | ||
mem.rs | ||
microtask.rs | ||
network_listener.rs | ||
realms.rs | ||
script_module.rs | ||
script_runtime.rs | ||
script_thread.rs | ||
serviceworker_manager.rs | ||
stylesheet_loader.rs | ||
stylesheet_set.rs | ||
task.rs | ||
task_manager.rs | ||
task_queue.rs | ||
test.rs | ||
textinput.rs | ||
timers.rs | ||
unpremultiplytable.rs | ||
webdriver_handlers.rs |