@@ -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
|
#if PLATFORM_ARCH_X86 || PLATFORM_ARCH_X64
|
||||||
// Check the minimum vector instruction set support
|
// Check the minimum vector instruction set support
|
||||||
int32 cpuInfo[4] = { -1 };
|
int32 cpuInfo[4] = { -1 };
|
||||||
@@ -597,10 +595,19 @@ void WindowsPlatform::PreInit(void* hInstance)
|
|||||||
{
|
{
|
||||||
// Not supported CPU
|
// Not supported CPU
|
||||||
CPUBrand 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);
|
exit(-1);
|
||||||
}
|
}
|
||||||
#endif
|
#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
|
// Disable the process from being showing "ghosted" while not responding messages during slow tasks
|
||||||
DisableProcessWindowsGhosting();
|
DisableProcessWindowsGhosting();
|
||||||
|
|||||||
@@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
#include "../common/TracyYield.hpp"
|
#include "../common/TracyYield.hpp"
|
||||||
|
|
||||||
|
#if PLATFORM_WINDOWS
|
||||||
|
extern void CheckInstructionSet();
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace tracy
|
namespace tracy
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -18,6 +22,10 @@ tracy_no_inline static void InitRpmallocPlumbing()
|
|||||||
const auto done = RpInitDone.load( std::memory_order_acquire );
|
const auto done = RpInitDone.load( std::memory_order_acquire );
|
||||||
if( !done )
|
if( !done )
|
||||||
{
|
{
|
||||||
|
#if PLATFORM_WINDOWS
|
||||||
|
// Check instruction set before executing any code (Tracy init static vars before others)
|
||||||
|
CheckInstructionSet();
|
||||||
|
#endif
|
||||||
int expected = 0;
|
int expected = 0;
|
||||||
while( !RpInitLock.compare_exchange_weak( expected, 1, std::memory_order_release, std::memory_order_relaxed ) ) { expected = 0; YieldThread(); }
|
while( !RpInitLock.compare_exchange_weak( expected, 1, std::memory_order_release, std::memory_order_relaxed ) ) { expected = 0; YieldThread(); }
|
||||||
const auto done = RpInitDone.load( std::memory_order_acquire );
|
const auto done = RpInitDone.load( std::memory_order_acquire );
|
||||||
|
|||||||
Reference in New Issue
Block a user