From 32d584a0f5f58ff80ab9ad95ff3d1b10e30d108f Mon Sep 17 00:00:00 2001 From: iwubcode Date: Sat, 27 Feb 2021 16:41:50 -0600 Subject: InputCommon: reduce number of image loads and texture cache invalidations by only running dynamic input textures once for all controllers --- Source/Core/InputCommon/InputProfile.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Source/Core/InputCommon/InputProfile.cpp') diff --git a/Source/Core/InputCommon/InputProfile.cpp b/Source/Core/InputCommon/InputProfile.cpp index 9037d79044..c48d50dae3 100644 --- a/Source/Core/InputCommon/InputProfile.cpp +++ b/Source/Core/InputCommon/InputProfile.cpp @@ -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 { -- cgit v1.2.3