Add improved GPU crashes reporting

This commit is contained in:
Wojtek Figat
2025-01-24 22:56:52 +01:00
parent d4c72487cd
commit d501018feb
9 changed files with 132 additions and 140 deletions

View File

@@ -348,8 +348,8 @@ void PlatformBase::Fatal(const StringView& msg, void* context, FatalErrorType er
LOG(Error, "Used Physical Memory: {0} ({1}%)", Utilities::BytesToText(memoryStats.UsedPhysicalMemory), (int32)(100 * memoryStats.UsedPhysicalMemory / memoryStats.TotalPhysicalMemory));
LOG(Error, "Used Virtual Memory: {0} ({1}%)", Utilities::BytesToText(memoryStats.UsedVirtualMemory), (int32)(100 * memoryStats.UsedVirtualMemory / memoryStats.TotalVirtualMemory));
const ProcessMemoryStats processMemoryStats = Platform::GetProcessMemoryStats();
LOG(Error, "Process Used Physical Memory: {0}", Utilities::BytesToText(processMemoryStats.UsedPhysicalMemory));
LOG(Error, "Process Used Virtual Memory: {0}", Utilities::BytesToText(processMemoryStats.UsedVirtualMemory));
LOG(Error, "Process Used Physical Memory: {0} ({1}%)", Utilities::BytesToText(processMemoryStats.UsedPhysicalMemory), (int32)(100 * processMemoryStats.UsedPhysicalMemory / memoryStats.TotalPhysicalMemory));
LOG(Error, "Process Used Virtual Memory: {0} ({1}%)", Utilities::BytesToText(processMemoryStats.UsedVirtualMemory), (int32)(100 * processMemoryStats.UsedVirtualMemory / memoryStats.TotalVirtualMemory));
}
}
if (Log::Logger::LogFilePath.HasChars())

View File

@@ -140,6 +140,12 @@ API_ENUM() enum class FatalErrorType
Assertion,
// Program run out of memory to allocate.
OutOfMemory,
// The graphics device crashed, has been removed or restarted.
GPUCrash,
// The graphics device stopped responding (eg. incorrect rendering code or bug in driver).
GPUHang,
// The graphics device run out of video memory to allocate.
GPUOutOfMemory,
};
API_INJECT_CODE(cpp, "#include \"Engine/Platform/Platform.h\"");