Skip to content

Conversation

kunalmohan
Copy link
Contributor

This PR aims to make updating Webrender presentation data non-blocking.
A callback is passed to the buffer_map_async() fn wherein the data is read and a message sent to the server itself to write the data into the shared PresentationData struct object.

r?@kvark


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #___ (GitHub issue number if applicable)
  • There are tests for these changes OR
  • These changes do not require tests because ___

@highfive
Copy link

highfive commented Jul 2, 2020

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/gpucanvascontext.rs
  • @KiChjang: components/script/dom/gpucanvascontext.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 2, 2020
@highfive
Copy link

highfive commented Jul 2, 2020

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify script code, but no tests are modified. Please consider adding a test!

@kunalmohan
Copy link
Contributor Author

I am facing one problem here. Inside the buffer_map_async() callback, sender doesn't send the UpdateWebRenderData message. There's no panic or error too. The control doesn't get past that code block responsible to send that message.

(There are some debug logs here which I'll remove once this problem gets solved)

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable

@kunalmohan kunalmohan force-pushed the async-presentation branch from a14ac8c to b672b78 Compare July 3, 2020 10:35
@kunalmohan
Copy link
Contributor Author

The error was probably due to the data-carrying capacity of IpcSender. Reading the data in UpdateWebRenderData instead of sending it over from the async callback solved the issue.

I have also edited the buffer data exchange between content process and server to use IpcSharedMemory instead of Vec in BufferMapAsync and UnmapBuffer.

@kunalmohan kunalmohan marked this pull request as ready for review July 3, 2020 10:41
Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much nicer! One concern though

@kvark
Copy link
Member

kvark commented Jul 3, 2020

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit b672b78 has been approved by kvark

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jul 3, 2020
@bors-servo
Copy link
Contributor

⌛ Testing commit b672b78 with merge 39060ca...

bors-servo added a commit that referenced this pull request Jul 3, 2020
WebGPU update presentation data asynchronously

<!-- Please describe your changes on the following line: -->
This PR aims to make updating Webrender presentation data non-blocking.
A callback is passed to the `buffer_map_async()` fn wherein the data is read and a message sent to the server itself to write the data into the shared `PresentationData` struct object.

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
- [ ] 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. -->
@bors-servo
Copy link
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 3, 2020
@jdm
Copy link
Member

jdm commented Jul 3, 2020

bors-servo added a commit that referenced this pull request Jul 3, 2020
WebGPU update presentation data asynchronously

<!-- Please describe your changes on the following line: -->
This PR aims to make updating Webrender presentation data non-blocking.
A callback is passed to the `buffer_map_async()` fn wherein the data is read and a message sent to the server itself to write the data into the shared `PresentationData` struct object.

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
- [ ] 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. -->
@bors-servo
Copy link
Contributor

⌛ Testing commit b672b78 with merge b3a351d...

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jul 3, 2020
@bors-servo
Copy link
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 3, 2020
@jdm
Copy link
Member

jdm commented Jul 3, 2020

@bors-servo
Copy link
Contributor

⌛ Testing commit b672b78 with merge 7fafd91...

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jul 3, 2020
@bors-servo
Copy link
Contributor

☀️ Test successful - status-taskcluster
Approved by: kvark
Pushing 7fafd91 to master...

@bors-servo bors-servo merged commit 7fafd91 into servo:master Jul 3, 2020
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 3, 2020
@kunalmohan kunalmohan deleted the async-presentation branch July 3, 2020 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants