Merge branch 'update_tracy' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-update_tracy

This commit is contained in:
Wojtek Figat
2025-06-04 23:53:32 +02:00
26 changed files with 2774 additions and 687 deletions

View File

@@ -42,17 +42,17 @@ void* WindowsPlatform::Instance = nullptr;
extern "C" {
static HANDLE dbgHelpLock;
void DbgHelpInit()
void FlaxDbgHelpInit()
{
dbgHelpLock = CreateMutexW(nullptr, FALSE, nullptr);
}
void DbgHelpLock()
void FlaxDbgHelpLock()
{
WaitForSingleObject(dbgHelpLock, INFINITE);
}
void DbgHelpUnlock()
void FlaxDbgHelpUnlock()
{
ReleaseMutex(dbgHelpLock);
}
@@ -544,7 +544,7 @@ void WindowsPlatform::PreInit(void* hInstance)
#if CRASH_LOG_ENABLE
TCHAR buffer[MAX_PATH] = { 0 };
DbgHelpLock();
FlaxDbgHelpLock();
if (::GetModuleFileNameW(::GetModuleHandleW(nullptr), buffer, MAX_PATH))
SymbolsPath.Add(StringUtils::GetDirectoryName(buffer));
if (::GetEnvironmentVariableW(TEXT("_NT_SYMBOL_PATH"), buffer, MAX_PATH))
@@ -553,7 +553,7 @@ void WindowsPlatform::PreInit(void* hInstance)
options |= SYMOPT_LOAD_LINES | SYMOPT_FAIL_CRITICAL_ERRORS | SYMOPT_DEFERRED_LOADS | SYMOPT_EXACT_SYMBOLS;
SymSetOptions(options);
OnSymbolsPathModified();
DbgHelpUnlock();
FlaxDbgHelpUnlock();
#endif
GetWindowsVersion(WindowsName, VersionMajor, VersionMinor, VersionBuild);
@@ -767,7 +767,7 @@ void WindowsPlatform::BeforeExit()
void WindowsPlatform::Exit()
{
#if CRASH_LOG_ENABLE
DbgHelpLock();
FlaxDbgHelpLock();
#if !TRACY_ENABLE
if (SymInitialized)
{
@@ -776,7 +776,7 @@ void WindowsPlatform::Exit()
}
#endif
SymbolsPath.Resize(0);
DbgHelpUnlock();
FlaxDbgHelpUnlock();
#endif
// Unregister app class
@@ -1278,14 +1278,14 @@ void* WindowsPlatform::LoadLibrary(const Char* filename)
#if CRASH_LOG_ENABLE
// Refresh modules info during next stack trace collecting to have valid debug symbols information
DbgHelpLock();
FlaxDbgHelpLock();
if (folder.HasChars() && !SymbolsPath.Contains(folder))
{
SymbolsPath.Add(folder);
SymbolsPath.Last().Replace('/', '\\');
OnSymbolsPathModified();
}
DbgHelpUnlock();
FlaxDbgHelpUnlock();
#endif
return handle;
@@ -1296,7 +1296,7 @@ void* WindowsPlatform::LoadLibrary(const Char* filename)
Array<PlatformBase::StackFrame> WindowsPlatform::GetStackFrames(int32 skipCount, int32 maxDepth, void* context)
{
Array<StackFrame> result;
DbgHelpLock();
FlaxDbgHelpLock();
// Initialize
HANDLE process = GetCurrentProcess();
@@ -1428,7 +1428,7 @@ Array<PlatformBase::StackFrame> WindowsPlatform::GetStackFrames(int32 skipCount,
}
}
DbgHelpUnlock();
FlaxDbgHelpUnlock();
return result;
}