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

Core / DolphinQt / InputCommon: reduce the number disk writes when using DynamicInputTextures #13311

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

iwubcode
Copy link
Contributor

@iwubcode iwubcode commented Jan 26, 2025

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() and SaveConfig(). 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.

@iwubcode iwubcode force-pushed the dynamic_input_textures_reduce_image_writes branch from 56bef66 to 506e019 Compare January 26, 2025 04:31
@JosJuice
Copy link
Member

JosJuice commented Jan 26, 2025

Does this handle the case where a new controller profile is loaded using a game INI when launching a game from the Wii Menu?

Also, the changes you made to DolphinQt need to also be made to the Android frontend.

@iwubcode iwubcode force-pushed the dynamic_input_textures_reduce_image_writes branch from 506e019 to 1301b3a Compare January 26, 2025 22:38
@iwubcode iwubcode force-pushed the dynamic_input_textures_reduce_image_writes branch from 1301b3a to 59a828c Compare January 26, 2025 22:40
… normal loading (GC, also called for Wii..); update config for ES title change, generate textures for both situations
@iwubcode iwubcode force-pushed the dynamic_input_textures_reduce_image_writes branch from 59a828c to a792bdd Compare January 26, 2025 22:48
@iwubcode
Copy link
Contributor Author

iwubcode commented Jan 26, 2025

ES title loading was messy. It wasn't even loading the input profiles when launching the game from the Wii menu?

I've tried to decouple some of the logic but I'm sure we could clean up the code more in a future pass.

Tested:

  • Load Wii game normally with profile and see textures generate and load
  • Load Wii game normally without profile and see textures generate and load
  • Load Wii game from Wii system menu with profile and see textures generate and load
  • Load Wii game normally without profile and see textures generate and load from normal config
  • Load GC game normally without profile and see textures generate and load from normal config
  • Load GC game from Wii system menu and see textures generate and load with normal config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants