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

Filter unused runtime nodes #10813

Merged
merged 3 commits into from
Sep 23, 2022
Merged

Filter unused runtime nodes #10813

merged 3 commits into from
Sep 23, 2022

Conversation

ptrgags
Copy link
Contributor

@ptrgags ptrgags commented Sep 23, 2022

This PR fixes a corner case where unused glTF nodes would cause Model to crash at runtime.

ModelSceneGraph keeps an array of runtime nodes that is the same length as the list of nodes in the glTF. However, unused nodes are undefined entries in this array. The loops in configurePipeline and update weren't filtering out this corner case.

This bug was first reported in this forum post, see the thread for an example tileset.

@cesium-concierge
Copy link

Thanks for the pull request @ptrgags!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.

@ptrgags ptrgags changed the title Filter unused nodes Filter unused runtime nodes Sep 23, 2022
@ptrgags ptrgags marked this pull request as ready for review September 23, 2022 13:17
@ptrgags
Copy link
Contributor Author

ptrgags commented Sep 23, 2022

This PR is now ready, @sanjeetsuhag could you review?

Copy link
Contributor

@sanjeetsuhag sanjeetsuhag left a comment

Choose a reason for hiding this comment

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

Looks good @ptrgags. I tested it by adding empty nodes to the BoxInstanced.gltf file and it fixed the crash. From the screenshot posted on the community forum, seems like it was fixed there too.

@sanjeetsuhag sanjeetsuhag merged commit 9472358 into main Sep 23, 2022
@sanjeetsuhag sanjeetsuhag deleted the filter-unused-nodes branch September 23, 2022 14:17
This pull request was closed.
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.

3 participants