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 upAllow more WebGL2 FBO attachment formats #25852
Conversation
highfive
commented
Feb 27, 2020
|
Heads up! This PR modifies the following files:
|
|
@bors-servo r+ |
|
|
Allow more WebGL2 FBO attachment formats Add support for most of the framebuffer attachment formats introduced in WebGL2 for textures and renderbuffers. Related format tables: - https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml - https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glRenderbufferStorage.xhtml <!-- Please describe your changes on the following line: --> cc @jdm @zakorgy --- <!-- 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. -->
|
|
|
This seems to be affecting the WebGL1 tests in unexpected ways:
|
1ac633e
to
09b0962
|
Added a workaround for that which should fix the issue. I wonder though if there's some better way to append values to the constrains. |
| &[constants::DEPTH_STENCIL][..], | ||
| ]; | ||
| let attachment_constraints = match self.webgl_version { | ||
| WebGLVersion::WebGL1 => [ |
This comment has been minimized.
This comment has been minimized.
jdm
Mar 2, 2020
Member
If the Webgl2 constraints are a superset of the webgl1 constraints, we should be able to do:
let webgl1_attachment_constraints = &[[constants::DEPTH_COMPONENT16, ...][..], &[constants::STENCIL_INDEX8, ...][..], &[constants::DEPTH_STENCIL][..]];
let webgl2_attachment_constraints = &[[constants::DEPTH_STENCIL][..], &[constants::DEPTH_STENCIL][..], &[]];
let empty = &[];
let extra_constraints = match self.webgl_version {
WebGLVersion::WebGL1 => empty.iter(),
WebGLVersion::WebGL2 => webgl2_attachment_constraints.iter(),
};
let attachment_constraints = webgl1_attachment_constraints.iter().zip(extra_constraints).map(|(a, b)| a.iter().chain(b.iter()));Then any code like check_attachment_constraints that iterates over the constraints can use impl Iterator<&'a u32>. I made a snippet at https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=e0cda590f60315bf122372e123bdf318 to demonstrate.
This comment has been minimized.
This comment has been minimized.
|
@bors-servo try=wpt |
…try> Allow more WebGL2 FBO attachment formats Add support for most of the framebuffer attachment formats introduced in WebGL2 for textures and renderbuffers. Related format tables: - https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml - https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glRenderbufferStorage.xhtml <!-- Please describe your changes on the following line: --> cc @jdm @zakorgy --- <!-- 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. -->
|
This also needs a |
|
|
09b0962
to
9fc8ab5
|
Updated, thanks. |
|
Needs a |
Add support for most of the framebuffer attachment formats introduced in WebGL2 for textures and renderbuffers. Related format tables: - https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml - https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glRenderbufferStorage.xhtml
9fc8ab5
to
859a3a4
|
Ah sorry, fixed. |
|
@bors-servo r+ |
|
|
Allow more WebGL2 FBO attachment formats Add support for most of the framebuffer attachment formats introduced in WebGL2 for textures and renderbuffers. Related format tables: - https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml - https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glRenderbufferStorage.xhtml <!-- Please describe your changes on the following line: --> cc @jdm @zakorgy --- <!-- 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 retry |
|
|
mmatyas commentedFeb 27, 2020
Add support for most of the framebuffer attachment formats introduced in WebGL2 for textures and renderbuffers.
Related format tables:
cc @jdm @zakorgy
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors