GUI: Add CPU extension info to About dialog

This commit is contained in:
Kaloyan Chehlarski 2023-11-13 23:40:01 +02:00
parent 654879f507
commit 226470434f

View File

@ -115,6 +115,42 @@ AboutDialog::AboutDialog()
_lines.push_back(Common::U32String());
Common::U32String extensionSupportString[3] = { _("not supported"), _("disabled"), _("enabled") };
byte sse2Support = 0;
byte avx2Support = 0;
byte neonSupport = 0;
#ifdef SCUMMVM_SSE2
++sse2Support;
if (g_system->hasFeature(OSystem::kFeatureCpuSSE2))
++sse2Support;
#endif
#ifdef SCUMMVM_AVX2
++avx2Support;
if (g_system->hasFeature(OSystem::kFeatureCpuAVX2))
++avx2Support;
#endif
#ifdef SCUMMVM_NEON
++neonSupport;
if (g_system->hasFeature(OSystem::kFeatureCpuNEON))
++neonSupport;
#endif
Common::U32String extensionsInfo("C1");
// I18N: CPU extensions are sets of extra processor instructions used to speed up operations. See Intel AVX2, ARM NEON, etc.
extensionsInfo += _("CPU extensions support:");
addLine(extensionsInfo);
Common::U32String compiledExtensionsList("C0");
compiledExtensionsList += Common::U32String::format("SSE2(%S) AVX2(%S) NEON(%S)",
extensionSupportString[sse2Support].c_str(),
extensionSupportString[avx2Support].c_str(),
extensionSupportString[neonSupport].c_str());
addLine(compiledExtensionsList);
_lines.push_back(Common::U32String());
Common::U32String engines("C1");
engines += _("Available engines:");
addLine(engines);