-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
|
||
// 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
r? @emilio |
@@ -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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
0288fde
to
8f92097
Compare
Added checks for enum values with the stencil functions. |
_ => return self.webgl_error(InvalidEnum), | ||
} | ||
|
||
match fail { |
There was a problem hiding this comment.
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
8f92097
to
2da487e
Compare
Created a new function for checking stencil op parameters. |
2da487e
to
4a16619
Compare
☔ The latest upstream changes (presumably #10667) made this pull request unmergeable. Please resolve the merge conflicts. |
6d767db
to
23eac18
Compare
Is now blocked on #10678. |
1fe62f0
to
1107c23
Compare
Should be ok to review now. |
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. Comments from Reviewable |
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 -->
💔 Test failed - mac-rel-wpt |
It seems likely that #10790 is not actually intermittent and is a permanent failure exposed by the current set of changes. |
Yeah, it's consistently failed on OS X every time there hasn't been a linux failure first. |
That test should be fixed by #10443. Look at this comment though, to see why new correct implementations can lead to new test failures. |
☔ The latest upstream changes (presumably #10443) made this pull request unmergeable. Please resolve the merge conflicts. |
1107c23
to
2946fbe
Compare
@bors-servo try |
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 -->
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt |
@bors-servo r=emilio |
📌 Commit 2946fbe has been approved by |
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 -->
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt |
I'd rather have waited for #10806 to land... But well, it landed so... :P |
Depends on servo/webrender#261.
Closes #10659.
This change is