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

Better handling of feature ID + metadata textures #1369

Open
j9liu opened this issue Feb 29, 2024 · 0 comments
Open

Better handling of feature ID + metadata textures #1369

j9liu opened this issue Feb 29, 2024 · 0 comments
Labels
performance Improvements to performance, including reductions in memory usage

Comments

@j9liu
Copy link
Contributor

j9liu commented Feb 29, 2024

#1330 introduced a new texture system that deletes the CPU memory once the data is copied to the GPU. However, this introduces problems for feature ID texture + property texture property picking, which depended on image.pixelData to remain on the CPU.

#1367 was a band-aid fix for such scenarios, by copying any textures that happen to be used by the material. But we should have a more robust solution, because this can potentially create too many copies. For instance, two property texture properties can sample the same texture, just at different channels.

One idea I had is to just move the deletion of the textures after every single texture in the model has been processed. During creation, we can just mark if a CPU texture should be deleted, then do a final pass over all the textures in a model. This feels most safe, though I don't know if that undoes or interferes with any of the work that #1330 did.

@kring also suggested:

the "best" solution here is to have even metadata textures be on the CPU or the GPU, but not both (i.e., have only one copy of each texture in memory ever), even if that requires a GPU read-back in some cases.

So a future solution could be to keep the memory on the GPU, but add code that can read-back from the GPU and sample the texture.

@j9liu j9liu added the performance Improvements to performance, including reductions in memory usage label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Improvements to performance, including reductions in memory usage
Projects
None yet
Development

No branches or pull requests

1 participant