-
Notifications
You must be signed in to change notification settings - Fork 63
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
Consider warning on redundant definitions #163
Comments
This is interesting. Is the three.js loader deduping identical textures? I would not expect loaders to do this.
+1 |
How should |
Currently not, but we may start de-duping
Ideally some type of "deep equality", but even skipping redundancy detection on anything with |
Recently we had a couple user-facing bugs in three.js (mrdoob/three.js#21559, mrdoob/three.js#21819) which came down to redundant definitions in a glTF file. Both bugs led to duplicate instances of the THREE.Texture class and redundant GPU texture allocation:
This output came from Blender:
And this output came from the Babylon.js 3DS Max Exporter:
Both pass the validator, and aren't "wrong", but — especially in the first example — it's difficult for our loader to do deep comparisons and figure out how many things to allocate. Equivalently, the textures could have (but didn't) referred to different but identical samplers, and we'll (still) end up allocating extra texture memory in that case.
The second case, with the texture transform, partially our fault because of limitations in our
KHR_texture_transform
support, but basically the extension isn't doing anything here and would ideally not be included.tl;dr – it'd be helpful for the ecosystem if the validator could flag redundant definitions, like identical samplers and textures.
The text was updated successfully, but these errors were encountered: