InputCommon: reduce number of image loads and texture cache invalidations by only running dynamic input textures once for all controllers

This commit is contained in:
iwubcode 2021-02-27 16:41:50 -06:00
parent 158674c274
commit 32d584a0f5
10 changed files with 117 additions and 123 deletions

View file

@ -73,7 +73,8 @@ std::string ProfileCycler::GetProfile(CycleDirection cycle_direction, int& profi
}
void ProfileCycler::UpdateToProfile(const std::string& profile_filename,
ControllerEmu::EmulatedController* controller)
ControllerEmu::EmulatedController* controller,
InputConfig* device_configuration)
{
std::string base;
SplitPath(profile_filename, nullptr, &base, nullptr);
@ -86,6 +87,7 @@ void ProfileCycler::UpdateToProfile(const std::string& profile_filename,
display_message_ms);
controller->LoadConfig(ini_file.GetOrCreateSection("Profile"));
controller->UpdateReferences(g_controller_interface);
device_configuration->GenerateControllerTextures(ini_file);
}
else
{
@ -129,7 +131,7 @@ void ProfileCycler::CycleProfile(CycleDirection cycle_direction, InputConfig* de
auto* controller = device_configuration->GetController(controller_index);
if (controller)
{
UpdateToProfile(profile, controller);
UpdateToProfile(profile, controller, device_configuration);
}
else
{
@ -168,7 +170,7 @@ void ProfileCycler::CycleProfileForGame(CycleDirection cycle_direction,
auto* controller = device_configuration->GetController(controller_index);
if (controller)
{
UpdateToProfile(profile, controller);
UpdateToProfile(profile, controller, device_configuration);
}
else
{