Zero-copy importer plugin APIs #240
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
It's great to see how the design nicely fermented over the three and half (!!) years. This is a completely opt-in feature for all plugins involved, so if the plugin decides to not do anything about it, it doesn't have to. The actual enforcements will come later.
Because there's no format ever that would support zero-copy everything (except the upcoming Magnum blobs, hah!), it makes no sense to force zero-copy globally. Instead, zero-copy can be forced just for particular data of interest. For example a glTF can zero-copy-import mesh and animation data, but not always image data (except if it embeds an uncompressed KTX), and never scene or material data, which are stored in the textual JSON.
@@ Coverage Diff @@ ## master #240 +/- ## ======================================= Coverage 79.97% 79.98% ======================================= Files 511 511 Lines 32354 32363 +9 ======================================= + Hits 25875 25885 +10 + Misses 6479 6478 -1
Meant to be used from within plugin implementations to avoid copies in the delegated importers. TODO: the heck, why can't I call a protected function from a subclass but another instance? TODO: figure out a way to test this TODO: update docs and behavior for the ZeroCopy flag TODO: adapt AnySceneImporter also
Update Magnum projects and switch to CgltfImporter from TinyGltfImporter facebookresearch/habitat-sim#1549
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.