diff options
author | bors-servo <servo-ops@mozilla.com> | 2020-06-27 14:29:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-27 14:29:08 -0400 |
commit | af110ac21fcf1e108c919f5e9d724b2441996ed6 (patch) | |
tree | 6c233f8d39d2144d24a55fa71c5c4a828700cc40 /components/script/dom/document.rs | |
parent | 223b6843dbe31dacd945ba9a21b4023224add5e9 (diff) | |
parent | db2d313a1b76886c656a90280bfe4f44b909d977 (diff) | |
download | servo-af110ac21fcf1e108c919f5e9d724b2441996ed6.tar.gz servo-af110ac21fcf1e108c919f5e9d724b2441996ed6.zip |
Auto merge of #27084 - kunalmohan:gpu-buffer-mapping, r=kvark
Implement GPUBuffer.mapAsync and update wgpu-core
<!-- Please describe your changes on the following line: -->
This PR covers the following-
1. update wgpu-core to use serializable `RenderPass` and `ComputePass`. Implement `DispatchIndirect`.
2. Implement `GPUBuffer.mapAsync()`.
The `mapAsync()` methods has the following flow-
1. A new promise is created in `mapAsync()` and a message sent to the server-side. This returns a promise.
2. On the server-side, a `struct BufferMapInfo` object stores the relevant info required to send data to the client-side on completion of mapping. This object is stored in a `buffer_maps: HashMap<id::BufferId, BufferMapInfo<'a>>,` in `WGPU`. `buffers_maps` basically stores the data for buffers with pending mapping.
3. `buffer_map_async()` command is issued with a callback responsible to send the data back to the client.
4. All the devices are polled every time the server receives a new message.
5. The data is sent back on completion and promise resolved through `AsyncWGPUListener` (similar to how the `requestDevice()` and `RequestAdapter` are processed).
6. On receiving the data, the client sends back a `BufferMapComplete` message to the server to remove the entry from `buffer_maps` hashmap.
I intended to implement `getMappedRange()`, too, in this PR but it's quite a task in itself (implementing intersecting ArrayBuffers). This already being a 500+ line PR, I thought it best to get this model approved first (also it will probably be easier to review this and `getMappedRange` separately). `getMappedRange` would come up in the next one.
---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___
<!-- 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. -->
Diffstat (limited to 'components/script/dom/document.rs')
0 files changed, 0 insertions, 0 deletions