Add checking hardware instruction set on Windows earlier on

#3732
This commit is contained in:
Wojtek Figat
2025-10-27 16:48:24 +01:00
parent c944bd9bed
commit cd66d00219
2 changed files with 20 additions and 5 deletions

View File

@@ -543,11 +543,9 @@ void WindowsPlatform::ReleaseMutex()
}
}
void WindowsPlatform::PreInit(void* hInstance)
PRAGMA_DISABLE_OPTIMIZATION;
void CheckInstructionSet()
{
ASSERT(hInstance);
Instance = hInstance;
#if PLATFORM_ARCH_X86 || PLATFORM_ARCH_X64
// Check the minimum vector instruction set support
int32 cpuInfo[4] = { -1 };
@@ -597,10 +595,19 @@ void WindowsPlatform::PreInit(void* hInstance)
{
// Not supported CPU
CPUBrand cpu;
Error(String::Format(TEXT("Cannot start program due to lack of CPU feature {}.\n\n{}"), missingFeature, String(cpu.Buffer)));
Platform::Error(String::Format(TEXT("Cannot start program due to lack of CPU feature {}.\n\n{}"), missingFeature, String(cpu.Buffer)));
exit(-1);
}
#endif
}
PRAGMA_ENABLE_OPTIMIZATION;
void WindowsPlatform::PreInit(void* hInstance)
{
ASSERT(hInstance);
Instance = hInstance;
CheckInstructionSet();
// Disable the process from being showing "ghosted" while not responding messages during slow tasks
DisableProcessWindowsGhosting();