config: Retain Vulkan device selection from previous config format

This commit is contained in:
Exzap 2026-02-20 21:00:22 +01:00
parent 2096c434de
commit 4ca4d1caed
2 changed files with 7 additions and 1 deletions

View File

@ -127,7 +127,11 @@ XMLConfigParser CemuConfig::Load(XMLConfigParser& parser)
// graphics
auto graphic = parser.get("Graphic");
graphic_api = graphic.get("api", kOpenGL);
graphic.get("vkDevice", vk_graphic_device_uuid);
graphic.get("device", legacy_graphic_device_uuid);
if (graphic.get("vkDevice").valid())
graphic.get("vkDevice", vk_graphic_device_uuid);
else
vk_graphic_device_uuid = legacy_graphic_device_uuid;
mtl_graphic_device_uuid = graphic.get("mtlDevice", 0);
vsync = graphic.get("VSync", 0);
overrideAppGammaPreference = graphic.get("OverrideAppGammaPreference", false);
@ -359,6 +363,7 @@ XMLConfigParser CemuConfig::Save(XMLConfigParser& parser)
// graphics
auto graphic = config.set("Graphic");
graphic.set("api", graphic_api);
graphic.set("device", legacy_graphic_device_uuid);
graphic.set("vkDevice", vk_graphic_device_uuid);
graphic.set("mtlDevice", mtl_graphic_device_uuid);
graphic.set("VSync", vsync);

View File

@ -432,6 +432,7 @@ struct CemuConfig
// graphics
ConfigValue<GraphicAPI> graphic_api{ kVulkan };
std::array<uint8, 16> legacy_graphic_device_uuid{}; // placeholder option for backwards compatibility with settings from 2.6 and before (renamed to "vkDevice")
std::array<uint8, 16> vk_graphic_device_uuid;
uint64 mtl_graphic_device_uuid{ 0 };
ConfigValue<int> vsync{ 0 }; // 0 = off, 1+ = depending on render backend