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

Add Options::reduce_texture_memory to free up RAM #4431

Merged
merged 1 commit into from
May 28, 2024

Conversation

varphone
Copy link
Contributor

@varphone varphone commented Apr 28, 2024

Summary

This PR introduces a new configuration option reduce_texture_memory in egui.

Changes

  • Added reduce_texture_memory option in egui. When set to true, egui will discard the loaded image data after the texture is uploaded to the GPU, reducing memory usage. This is beneficial when handling a large number of images and retaining the image data is unnecessary, potentially saving substantial memory. However, this makes it impossible to serialize the loaded images or render on non-GPU systems. Default is false.

Impact

This new configuration option gives users more control over their memory usage, especially when dealing with a large number or large resolution of images. It allows users to optimize their applications based on their specific needs and constraints.

Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

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

The feature makes sense. I'm not 100% sold on the name, but don't have a better suggestion either 🤷

@emilk emilk added the egui label May 27, 2024
@emilk
Copy link
Owner

emilk commented May 27, 2024

merge conflict

If `true`, `egui` will discard the loaded image data after
the texture is loaded onto the GPU to reduce memory usage.
@varphone
Copy link
Contributor Author

merge conflict

Merge conflicts have been fixed.

@emilk emilk changed the title egui: Added reduce_texture_memory to Options Add Options::reduce_texture_memory to free up RAM May 28, 2024
@emilk emilk merged commit 6f59a14 into emilk:master May 28, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants