Skip to content

Initial implementation of WebGLSync - #24250

Merged
bors-servo merged 1 commit into
servo:masterfrom
imiklos:webglsync
Oct 2, 2019
Merged

bors-servo merged 1 commit into
servo:masterfrom
imiklos:webglsync

Conversation

@imiklos

@imiklos imiklos commented Sep 20, 2019 •

Copy link
Copy Markdown

This patch adds initial support for WebGLSync.

Note:
There is no test for the isSync, deleteSync and waitSync functions in the conformance2/sync/sync-webgl-specific.html.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • There are tests for these changes

This change is Reviewable

@highfive

Copy link
Copy Markdown

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon.

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/webglrenderingcontext.rs, components/script/dom/webidls/WebGL2RenderingContext.webidl, components/script/dom/webidls/WebGLSync.webidl, components/script/dom/mod.rs, components/script/dom/bindings/trace.rs and 2 more
  • @jgraham: tests/wpt/webgl/meta/conformance2/sync/sync-webgl-specific.html.ini
  • @KiChjang: components/script/dom/webglrenderingcontext.rs, components/script/dom/webidls/WebGL2RenderingContext.webidl, components/script/dom/webidls/WebGLSync.webidl, components/script/dom/mod.rs, components/script/dom/bindings/trace.rs and 2 more

@highfive

Copy link
Copy Markdown

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Sep 20, 2019
Comment thread components/script/dom/webglsync.rs Outdated

impl WebGLSync {
pub fn client_wait_sync(&self, context: &WebGLRenderingContext, flags: u32, timeout: u64) {
if self.get_client_sync_status().is_none() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If the timeout is hit and calling code wants to wait again, won't this return incorrect results the second time?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think the second result will be incorrect, I should check if the status is TIMEOUT_EXPIRED or WAIT_FAILED.

Comment thread components/script/dom/webglsync.rs Resolved
@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Sep 20, 2019
@jdm jdm assigned jdm and unassigned Manishearth Sep 20, 2019
@jdm

jdm commented Sep 20, 2019

Copy link
Copy Markdown
Member

Also some build errors:

�[0m�[1m�[38;5;9merror[E0061]�[0m�[0m�[1m: this function takes 5 parameters but 2 parameters were supplied�[0m
�[0m    �[0m�[0m�[1m�[38;5;12m--> �[0m�[0mcomponents/canvas/webgl_thread.rs:1383:38�[0m
�[0m     �[0m�[0m�[1m�[38;5;12m|�[0m
�[0m�[1m�[38;5;12m1383�[0m�[0m �[0m�[0m�[1m�[38;5;12m| �[0m�[0m                let value = ctx.gl().get_sync_iv(sync_id.get() as *const _, param);�[0m
�[0m     �[0m�[0m�[1m�[38;5;12m| �[0m�[0m                                     �[0m�[0m�[1m�[38;5;9m^^^^^^^^^^^�[0m�[0m �[0m�[0m�[1m�[38;5;9mexpected 5 parameters�[0m

�[0m�[1m�[38;5;9merror[E0608]�[0m�[0m�[1m: cannot index into a value of type `()`�[0m
�[0m    �[0m�[0m�[1m�[38;5;12m--> �[0m�[0mcomponents/canvas/webgl_thread.rs:1384:29�[0m
�[0m     �[0m�[0m�[1m�[38;5;12m|�[0m
�[0m�[1m�[38;5;12m1384�[0m�[0m �[0m�[0m�[1m�[38;5;12m| �[0m�[0m                sender.send(value[0] as u32).unwrap();�[0m
�[0m     �[0m�[0m�[1m�[38;5;12m| �[0m�[0m                            �[0m�[0m�[1m�[38;5;9m^^^^^^^^�[0m�[0m �[0m�[0m�[1m�[38;5;9mhelp: to access tuple elements, use: `value.0`�[0m

�[0m�[1m�[38;5;9merror�[0m�[0m�[1m: aborting due to 2 previous errors�[0m

@jdm

jdm commented Sep 20, 2019

Copy link
Copy Markdown
Member

This will need to use cargo update -p sparkle.

imiklos pushed a commit to imiklos/servo that referenced this pull request Sep 23, 2019
The following pull requests depend on it: servo#24250, servo#24178.
@imiklos imiklos mentioned this pull request Sep 23, 2019
3 tasks done
@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #24242) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Sep 24, 2019
bors-servo pushed a commit that referenced this pull request Sep 24, 2019
Update sparkle crate

The following pull requests depend on it: #24250, #24178.

<!-- Please describe your changes on the following line: -->

---
<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24266)
<!-- Reviewable:end -->
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Sep 24, 2019
@imiklos

imiklos commented Sep 24, 2019

Copy link
Copy Markdown
Author

Thank you for your review! I've updated the pull request. Added drop implementation and task queue for the sync_status fetching as you mentioned before.

bors-servo pushed a commit that referenced this pull request Sep 24, 2019
Update sparkle crate

The following pull requests depend on it: #24250, #24178.

<!-- Please describe your changes on the following line: -->

---
<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24266)
<!-- Reviewable:end -->
@jdm

jdm commented Sep 30, 2019

Copy link
Copy Markdown
Member

@bors-servo r+
Thanks!

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit fb043a3 has been approved by jdm

@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. S-needs-rebase There are merge conflict errors. labels Sep 30, 2019
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit fb043a3 with merge 68d3cbc...

bors-servo pushed a commit that referenced this pull request Sep 30, 2019
Initial implementation of WebGLSync

This patch adds initial support for [WebGLSync](https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.14).

Note:
There is no test for the isSync, deleteSync and waitSync functions in the `conformance2/sync/sync-webgl-specific.html`.

---
<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24250)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel-css

@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 Sep 30, 2019

@jdm jdm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The test results for the idlharness test in web-platform-tests/webgl/ will also need to be updated.

// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.14
//

interface WebGLSync : WebGLObject {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This needs to be gated on the WebGL2 preference:

const GLenum TEXTURE_MIN_LOD = 0x813A;

@jdm jdm added the S-needs-code-changes Changes have not yet been made that were requested by a reviewer. label Sep 30, 2019
@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #24178) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Oct 1, 2019
This patch adds initial support for WebGLSync.

Note:
There is no test for the isSync, deleteSync and waitSync functions in the `conformance2/sync/sync-webgl-specific.html`.
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Oct 2, 2019
@imiklos

imiklos commented Oct 2, 2019

Copy link
Copy Markdown
Author

Thanks, I've updated the pull request with the methods-2 and Pref changes, but I couldn't reproduce the idlharness fails.

@jdm

jdm commented Oct 2, 2019

Copy link
Copy Markdown
Member

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 248545d has been approved by jdm

@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. S-needs-rebase There are merge conflict errors. labels Oct 2, 2019
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 248545d with merge 13a43e6...

bors-servo pushed a commit that referenced this pull request Oct 2, 2019
Initial implementation of WebGLSync

This patch adds initial support for [WebGLSync](https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.14).

Note:
There is no test for the isSync, deleteSync and waitSync functions in the `conformance2/sync/sync-webgl-specific.html`.

---
<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24250)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: jdm
Pushing 13a43e6 to master...

@bors-servo
bors-servo merged commit 248545d into servo:master Oct 2, 2019
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 2, 2019
@bors-servo bors-servo mentioned this pull request Oct 2, 2019
3 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants