-
-
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 WebGL GetRenderbufferParameter #20631
Implement WebGL GetRenderbufferParameter #20631
Conversation
Heads up! This PR modifies the following files:
|
r? |
self.send_command(WebGLCommand::GetRenderbufferParameter(target, pname, sender)); | ||
|
||
match receiver.recv().unwrap() { | ||
value if value != 0 => Int32Value(value), |
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.
0
can be a valid result, right? I think it should be just Int32Value(receiver.recv().unwrap())
.
@bors-servo try |
…parameter, r=<try> Implement WebGL GetRenderbufferParameter This needed a bump of gleam to version 0.4.33 for this servo/gleam#162 <!-- Please describe your changes on the following line: --> I think my changes in test expectations are pretty naive and I have to wait for the PR to run on CI to see what the actual impact is. I'd like some guidance on this, too. --- <!-- 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 build-geckolib` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #20514 (github issue number if applicable). <!-- Either: --> - [x] 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. --> <!-- 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/20631) <!-- Reviewable:end -->
@@ -2345,6 +2345,41 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { | |||
Int32Value(receiver.recv().unwrap()) | |||
} | |||
|
|||
#[allow(unsafe_code)] | |||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.7 | |||
unsafe fn GetRenderbufferParameter(&self, _cx: *mut JSContext, target: u32, pname: u32) -> JSVal { |
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.
nit: For functions with many arguments, we usually indent like so
unsafe fn GetRenderbufferParameter(
&self,
...
) -> JSVal {
|
||
let (sender, receiver) = webgl_channel().unwrap(); | ||
self.send_command(WebGLCommand::GetRenderbufferParameter(target, pname, sender)); | ||
|
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.
The following check is missing:
If the renderbuffer currently bound to target is zero, then INVALID_- OPERATION is generated.
Reference
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's just this, basically :)
if self.bound_renderbuffer.get().is_none() {
self.webgl_error(InvalidOperation);
return NullValue();
}
💔 Test failed - linux-rel-wpt |
I'll get to this in the evening, thanks :) Also I think my expectations for test failures are wrong, I should be updating more |
6692241
to
3cefd52
Compare
3cefd52
to
a6b6568
Compare
I pushed changes regarding your suggestions and removed some more "expected to fail" |
a6b6568
to
6b166ce
Compare
Those are known failures, don't worry about them. The relevant ones are in the |
@bors-servo try |
…parameter, r=<try> Implement WebGL GetRenderbufferParameter This needed a bump of gleam to version 0.4.33 for this servo/gleam#162 <!-- Please describe your changes on the following line: --> I think my changes in test expectations are pretty naive and I have to wait for the PR to run on CI to see what the actual impact is. I'd like some guidance on this, too. --- <!-- 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 build-geckolib` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #20514 (github issue number if applicable). <!-- Either: --> - [x] 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. --> <!-- 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/20631) <!-- Reviewable:end -->
💔 Test failed - linux-rel-css |
r? @nox |
💔 Test failed - linux-rel-wpt |
@@ -1,29 +1,53 @@ | |||
[gl-object-get-calls.html] | |||
expected: ERROR | |||
[WebGL test #33: gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH) should be 2. Threw exception TypeError: gl.getRenderbufferParameter is not a function] | |||
expected: TIMEOUT |
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.
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.
IDK, I'm pushing again without the TIMEOUT
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.
Alright, let's see. Hope it works now :).
4b4c286
to
ff95682
Compare
@bors-servo try |
…parameter, r=<try> Implement WebGL GetRenderbufferParameter This needed a bump of gleam to version 0.4.33 for this servo/gleam#162 <!-- Please describe your changes on the following line: --> I think my changes in test expectations are pretty naive and I have to wait for the PR to run on CI to see what the actual impact is. I'd like some guidance on this, too. --- <!-- 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 build-geckolib` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #20514 (github issue number if applicable). <!-- Either: --> - [x] 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. --> <!-- 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/20631) <!-- Reviewable:end -->
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
Finally 😅 |
cc @nox |
I hope I don't need to solve conflicts again x_D |
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.
Looks good modulo that. Let me know if you prefer to move that in a followup, that's fine for me :)
if self.bound_renderbuffer.get().is_none() { | ||
self.webgl_error(InvalidOperation); | ||
return NullValue(); | ||
} |
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.
This should probably move after the target and parameter names, to preserve the same order used in https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glGetRenderbufferParameteriv.xml.
This needed a bump of gleam to version 0.4.33
Updated by running /mach test-wpt --log-raw /tmp/servo.log ./**/*1.0.3*/conformance/state/gl-object-get-calls.html ...and then ./mach update-wpt /tmp/servo.log
ff95682
to
a30674a
Compare
r? @emilio I moved the check to the place suggested. I thought of putting it there initially, but I thought it might be cheaper to check at the start because the second check needs |
@bors-servo r+ Yeah, in general optimizing for error paths isn't really necessary. And in this case it's observable, so there's not much we can do about it anyway. |
📌 Commit a30674a has been approved by |
…parameter, r=emilio Implement WebGL GetRenderbufferParameter This needed a bump of gleam to version 0.4.33 for this servo/gleam#162 <!-- Please describe your changes on the following line: --> I think my changes in test expectations are pretty naive and I have to wait for the PR to run on CI to see what the actual impact is. I'd like some guidance on this, too. --- <!-- 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 build-geckolib` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #20514 (github issue number if applicable). <!-- Either: --> - [x] 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. --> <!-- 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/20631) <!-- Reviewable:end -->
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
This needed a bump of gleam to version 0.4.33 for this servo/gleam#162
I think my changes in test expectations are pretty naive and I have to wait for the PR to run on CI to see what the actual impact is. I'd like some guidance on this, too.
./mach build -d
does not report any errors./mach build-geckolib
does not report any errors./mach test-tidy
does not report any errorsThis change is