Core / DolphinQt / InputCommon: reduce the number disk writes when using DynamicInputTextures #13311
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.
While working on an optimized system for asset loading, I wanted to make sure Dynamic Input Textures (DIT) still worked. While doing so, I found that images were being written to disk six times for one actual change. This PR reduces the image write down to the expected one time.
The reason for the six times was that the generate texture logic was being called on
LoadConfig()
andSaveConfig()
. I recall struggling on where to put the generation code previously that would hit every scenario (profile loading, game loading, and the various options in the input mapping window). When the input mapping is ran, multiple loads/configs are called, which causes excessive generation. I've removed the logic from those two functions and instead called them in each location.