MCPcopy Create free account
hub / github.com/ZDoom/Raze / UpdateGpuStats

Method UpdateGpuStats

source/common/rendering/vulkan/system/vk_commandbuffer.cpp:239–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239void VkCommandBufferManager::UpdateGpuStats()
240{
241 uint64_t timestamps[MaxTimestampQueries];
242 if (mNextTimestampQuery > 0)
243 mTimestampQueryPool->getResults(0, mNextTimestampQuery, sizeof(uint64_t) * mNextTimestampQuery, timestamps, sizeof(uint64_t), VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT);
244
245 double timestampPeriod = fb->device->PhysicalDevice.Properties.Properties.limits.timestampPeriod;
246
247 gpuStatOutput = "";
248 for (auto& q : timeElapsedQueries)
249 {
250 if (q.endIndex <= q.startIndex)
251 continue;
252
253 int64_t timeElapsed = max(static_cast<int64_t>(timestamps[q.endIndex] - timestamps[q.startIndex]), (int64_t)0);
254 double timeNS = timeElapsed * timestampPeriod;
255
256 FString out;
257 out.Format("%s=%04.2f ms\n", q.name.GetChars(), timeNS / 1000000.0f);
258 gpuStatOutput += out;
259 }
260 timeElapsedQueries.clear();
261 mGroupStack.clear();
262
263 gpuStatActive = keepGpuStatActive;
264 keepGpuStatActive = false;
265}

Callers 1

UpdateMethod · 0.80

Calls 4

getResultsMethod · 0.80
FormatMethod · 0.45
GetCharsMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected