| 95 | } |
| 96 | |
| 97 | void UnityDebug::update(uint64_t framecount) |
| 98 | { |
| 99 | /* Register and reset counts */ |
| 100 | unsigned int unity_job_count = 0; |
| 101 | for (ThreadInfo* th = ThreadManager::getThreadList(); th != nullptr; th = th->next) { |
| 102 | if (th->unityJobCount) { |
| 103 | jobData.AddPoint(framecount, th->unityJobCount, th->translated_tid); |
| 104 | unity_job_count += th->unityJobCount; |
| 105 | th->unityJobCount = 0; |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | jobData.AddPoint(framecount, unity_job_count, 0); |
| 110 | |
| 111 | /* Preload operations */ |
| 112 | if (preloadPending.size() <= framecount) |
| 113 | preloadPending.resize(framecount+1); |
| 114 | if (preloadProcessed.size() <= framecount) |
| 115 | preloadProcessed.resize(framecount+1); |
| 116 | |
| 117 | preloadPending[framecount] += preload_pending_count; |
| 118 | preloadProcessed[framecount] += preload_processed_count; |
| 119 | |
| 120 | /* Build the array that will be used to plot */ |
| 121 | preloadAll.clear(); |
| 122 | size_t size = 400; |
| 123 | size = std::min(size, preloadPending.size()); |
| 124 | size = std::min(size, preloadProcessed.size()); |
| 125 | |
| 126 | preloadAll.insert(preloadAll.end(), preloadProcessed.end() - size, preloadProcessed.end()); |
| 127 | preloadAll.insert(preloadAll.end(), preloadPending.end() - size, preloadPending.end()); |
| 128 | } |
| 129 | |
| 130 | void UnityDebug::draw(uint64_t framecount, bool* p_open = nullptr) |
| 131 | { |