Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for WebGL2 TexStorage2D #26023
Conversation
highfive
commented
Mar 24, 2020
|
Heads up! This PR modifies the following files:
|
|
Thanks, I was experimenting with adding a |
| height as u32, | ||
| 1, | ||
| TexFormat::from_gl_constant(internal_format).unwrap(), | ||
| levels as u32, |
This comment has been minimized.
This comment has been minimized.
jdm
Mar 27, 2020
Member
I stepped through the test failure in a debugger and realized that we are initializing a single level of the texture, but TexStorage2D expects all levels from 0 to levels to be initialized. See page 137 of https://www.khronos.org/registry/OpenGL/specs/es/3.0/es_spec_3.0.pdf#nameddest=section-3.8.4.
This comment has been minimized.
This comment has been minimized.
mmatyas
Mar 30, 2020
Author
Contributor
Ah you're right! Indeed I should've read the spec a bit more closely, I'll do some restructuring now.
|
So last week I've started restructuring things, which at first looked to be simple, but then I've ended up in the rabbit hole of dealing with texture formats: to store the format in the texture, I had to convert the integer to a TexFormat, but for that I had to add the enums for all the newly acceptable formats, but because the formats were now implemented, they were also accessible from each and every WebGL function, and so I also needed to implement the additional texture format and data type combination checks and update the verification of the texture related functions. Anyway, there are still quite a few failing test cases, but here's the current WIP status of this patch. I've run a tidy on it but not updated or regenerated all the tests yet. |
|
|
|
Well it keeps getting more and more out of scope, so I'll try to stop here for now. I've cleaned up the debug code, added the tests and rebased to master. There might be still a few misses here and there, but things seem to work mostly fine. |
|
I agree, I think we should merge what we have before it keeps getting bigger. Thanks for all the work to fix up the missing pieces here! |
| } | ||
|
|
||
| pub fn usable_as_internal(self) -> bool { | ||
| /*match self { |
This comment has been minimized.
This comment has been minimized.
| }; | ||
| if !dimensions_valid { | ||
| context.webgl_error(InvalidEnum); | ||
| return Err(TexImageValidationError::InvalidBorder); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@bors-servo r+ |
|
|
Add support for WebGL2 TexStorage2D Adds initial support for the WebGL2 `TexStorage2D` call, adds support for the related texture enums and enables some of the texture tests. See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.6 <!-- Please describe your changes on the following line: --> cc @jdm @zakorgy A couple of notes: - Currently `tests/wpt/webgl/meta/conformance2/textures` is disabled for testing; this patch enables the `misc` subdirectory and disables the rest, which is why there are so many new test files. The primary test for `TexStorage2D` is `conformance2/textures/misc/tex-storage-2d.html`. - Most of the test passes, except the "texSubImage2D should succeed on immutable texture as long as the format is compatible" checks. This produces INVALID_OPERATIONs [here](https://github.com/servo/servo/blob/d5e5414be372a28215c5162b1257765b89fbd619/components/script/dom/webglrenderingcontext.rs#L798) because the texture's image info is not set at that level. I'm probably forgetting to call `set_image_infos_at_level` somewhere but I'm not sure where. - There's a duplication of the internal texture format list with eg. the renderbuffer code, I wonder if there would be a good common place for it. --- <!-- 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 - [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. -->
|
|
|
@bors-servo r+ |
|
|
Add support for WebGL2 TexStorage2D Adds initial support for the WebGL2 `TexStorage2D` call, adds support for the related texture enums and enables some of the texture tests. See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.6 <!-- Please describe your changes on the following line: --> cc @jdm @zakorgy A couple of notes: - Currently `tests/wpt/webgl/meta/conformance2/textures` is disabled for testing; this patch enables the `misc` subdirectory and disables the rest, which is why there are so many new test files. The primary test for `TexStorage2D` is `conformance2/textures/misc/tex-storage-2d.html`. - Most of the test passes, except the "texSubImage2D should succeed on immutable texture as long as the format is compatible" checks. This produces INVALID_OPERATIONs [here](https://github.com/servo/servo/blob/d5e5414be372a28215c5162b1257765b89fbd619/components/script/dom/webglrenderingcontext.rs#L798) because the texture's image info is not set at that level. I'm probably forgetting to call `set_image_infos_at_level` somewhere but I'm not sure where. - There's a duplication of the internal texture format list with eg. the renderbuffer code, I wonder if there would be a good common place for it. --- <!-- 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 - [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. -->
|
|
Not sure if this is an intermittent failure, other than it, other failures are #25513 and #23290. |
|
@bors-servo retry |
|
|
mmatyas commentedMar 24, 2020
Adds initial support for the WebGL2
TexStorage2Dcall, adds support for the related texture enums and enables some of the texture tests.See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.6
cc @jdm @zakorgy
A couple of notes:
tests/wpt/webgl/meta/conformance2/texturesis disabled for testing; this patch enables themiscsubdirectory and disables the rest, which is why there are so many new test files. The primary test forTexStorage2Disconformance2/textures/misc/tex-storage-2d.html.set_image_infos_at_levelsomewhere but I'm not sure where../mach build -ddoes not report any errors./mach test-tidydoes not report any errors