Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement stencil fns for WebGLRenderingContext #10670

Merged
merged 1 commit into from
Apr 24, 2016

Conversation

KiChjang
Copy link
Contributor

Depends on servo/webrender#261.

Closes #10659.


This change is Reviewable

@highfive
Copy link

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/webglrenderingcontext.rs, components/script/dom/webidls/WebGLRenderingContext.webidl
  • @emilio: components/script/dom/webglrenderingcontext.rs

@highfive
Copy link

warning Warning warning

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

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 17, 2016

// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
fn StencilOpSeparate(&self, face: u32, fail: u32, zfail: u32, zpass: u32) {
self.ipc_renderer
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if these methods need to validate their parameters as described here.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, all parameters should be validated first taking in account the GLES2.0 spec, and later taking in account any details that the WebGL spec could specify.

@jdm
Copy link
Member

jdm commented Apr 17, 2016

r? @emilio

@highfive highfive assigned emilio and unassigned glennw Apr 17, 2016
@@ -1084,6 +1084,48 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
.unwrap()
}

// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
fn StencilFunc(&self, func: u32, ref_: i32, mask: u32) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these should validate the func parameter as described here

Copy link
Contributor Author

@KiChjang KiChjang Apr 17, 2016

Choose a reason for hiding this comment

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

In which case, should these functions have a [Throws] WebIDL attribute added to them?

Copy link
Member

Choose a reason for hiding this comment

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

Nope! WebGL errors are tracked via gl.getError(), not via return values or exceptions.

Copy link
Contributor

@cbrewster cbrewster Apr 17, 2016

Choose a reason for hiding this comment

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

I do not think so, none of the other functions that can result in a WebGL error seem to have a [Throws] WebIDL attribute. Although I am sure @emilio would have a better answer.

@KiChjang KiChjang force-pushed the webgl-stencils branch 3 times, most recently from 0288fde to 8f92097 Compare April 18, 2016 01:48
@KiChjang
Copy link
Contributor Author

Added checks for enum values with the stencil functions.

_ => return self.webgl_error(InvalidEnum),
}

match fail {
Copy link
Contributor

Choose a reason for hiding this comment

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

it might be nice if these were factored out

@KiChjang
Copy link
Contributor Author

Created a new function for checking stencil op parameters.

@bors-servo
Copy link
Contributor

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

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Apr 18, 2016
@KiChjang KiChjang force-pushed the webgl-stencils branch 2 times, most recently from 6d767db to 23eac18 Compare April 18, 2016 19:29
@KiChjang KiChjang removed the S-needs-rebase There are merge conflict errors. label Apr 18, 2016
@KiChjang
Copy link
Contributor Author

Is now blocked on #10678.

@KiChjang KiChjang force-pushed the webgl-stencils branch 2 times, most recently from 1fe62f0 to 1107c23 Compare April 19, 2016 16:58
@KiChjang
Copy link
Contributor Author

Should be ok to review now.

@emilio
Copy link
Member

emilio commented Apr 19, 2016

Looks good to me, I usually prefer the early return approach instead of if else, but feel free to r=me if you think it's not worth the change.

@bors-servo: try


Reviewed 1 of 5 files at r1, 1 of 1 files at r6.
Review status: all files reviewed at latest revision, 3 unresolved discussions.


Comments from Reviewable

@bors-servo
Copy link
Contributor

⌛ Trying commit 1107c23 with merge 1d0fc27...

bors-servo pushed a commit that referenced this pull request Apr 19, 2016
Implement stencil fns for WebGLRenderingContext

Depends on servo/webrender#261.

Closes #10659.

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

💔 Test failed - mac-rel-wpt

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Apr 22, 2016
@jdm
Copy link
Member

jdm commented Apr 22, 2016

It seems likely that #10790 is not actually intermittent and is a permanent failure exposed by the current set of changes.

@jdm
Copy link
Member

jdm commented Apr 22, 2016

Yeah, it's consistently failed on OS X every time there hasn't been a linux failure first.

@emilio
Copy link
Member

emilio commented Apr 22, 2016

That test should be fixed by #10443.

Look at this comment though, to see why new correct implementations can lead to new test failures.

@bors-servo
Copy link
Contributor

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

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Apr 22, 2016
@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. labels Apr 24, 2016
@KiChjang KiChjang removed the S-needs-rebase There are merge conflict errors. label Apr 24, 2016
@KiChjang
Copy link
Contributor Author

@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit 2946fbe with merge fc1eab7...

bors-servo pushed a commit that referenced this pull request Apr 24, 2016
Implement stencil fns for WebGLRenderingContext

Depends on servo/webrender#261.

Closes #10659.

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

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt

@KiChjang
Copy link
Contributor Author

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

📌 Commit 2946fbe has been approved by emilio

@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 Apr 24, 2016
@bors-servo
Copy link
Contributor

⌛ Testing commit 2946fbe with merge 7804173...

bors-servo pushed a commit that referenced this pull request Apr 24, 2016
Implement stencil fns for WebGLRenderingContext

Depends on servo/webrender#261.

Closes #10659.

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

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt

@bors-servo bors-servo merged commit 2946fbe into servo:master Apr 24, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 24, 2016
@emilio
Copy link
Member

emilio commented Apr 24, 2016

I'd rather have waited for #10806 to land... But well, it landed so... :P

@emilio emilio mentioned this pull request Apr 24, 2016
@KiChjang KiChjang deleted the webgl-stencils branch July 24, 2016 10:26
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.

None yet

9 participants