Skip to content

Commit 325e4d3

Browse files
Fix profiler crashing in the installer. (#1507)
1 parent 1555b97 commit 325e4d3

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

UnleashedRecomp/gpu/video.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,18 +2437,22 @@ static void DrawProfiler()
24372437

24382438
ImGui::NewLine();
24392439

2440-
O1HeapDiagnostics diagnostics, physicalDiagnostics;
2440+
if (g_userHeap.heap != nullptr && g_userHeap.physicalHeap != nullptr)
24412441
{
2442-
std::lock_guard lock(g_userHeap.mutex);
2443-
diagnostics = o1heapGetDiagnostics(g_userHeap.heap);
2444-
}
2445-
{
2446-
std::lock_guard lock(g_userHeap.physicalMutex);
2447-
physicalDiagnostics = o1heapGetDiagnostics(g_userHeap.physicalHeap);
2442+
O1HeapDiagnostics diagnostics, physicalDiagnostics;
2443+
{
2444+
std::lock_guard lock(g_userHeap.mutex);
2445+
diagnostics = o1heapGetDiagnostics(g_userHeap.heap);
2446+
}
2447+
{
2448+
std::lock_guard lock(g_userHeap.physicalMutex);
2449+
physicalDiagnostics = o1heapGetDiagnostics(g_userHeap.physicalHeap);
2450+
}
2451+
2452+
ImGui::Text("Heap Allocated: %d MB", int32_t(diagnostics.allocated / (1024 * 1024)));
2453+
ImGui::Text("Physical Heap Allocated: %d MB", int32_t(physicalDiagnostics.allocated / (1024 * 1024)));
24482454
}
2449-
2450-
ImGui::Text("Heap Allocated: %d MB", int32_t(diagnostics.allocated / (1024 * 1024)));
2451-
ImGui::Text("Physical Heap Allocated: %d MB", int32_t(physicalDiagnostics.allocated / (1024 * 1024)));
2455+
24522456
ImGui::Text("GPU Waits: %d", int32_t(g_waitForGPUCount));
24532457
ImGui::Text("Buffer Uploads: %d", int32_t(g_bufferUploadCount));
24542458
ImGui::NewLine();

0 commit comments

Comments
 (0)