MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / TryResolve

Method TryResolve

Source/Engine/Profiler/ProfilerGPU.cpp:47–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void ProfilerGPU::EventBuffer::TryResolve()
48{
49 if (_isResolved || _data.IsEmpty())
50 return;
51
52 // Collect queries results
53 PROFILE_MEM(Profiler);
54 auto device = GPUDevice::Instance;
55 auto queries = _data.Get();
56 for (int32 i = 0; i < _data.Count(); i++)
57 {
58 auto& e = queries[i];
59 ASSERT_LOW_LAYER(!e.QueryActive);
60 uint64 time;
61 if (device->GetQueryResult(e.Query, time, false))
62 {
63 e.Time = (float)time * 0.001f; // Convert to milliseconds
64 }
65 else
66 return; // Skip if one of the queries is not yet ready (frame still in-flight)
67 }
68
69 _isResolved = true;
70}
71
72int32 ProfilerGPU::EventBuffer::Add(const Event& e)
73{

Callers 1

BeginFrameMethod · 0.80

Calls 4

IsEmptyMethod · 0.45
GetMethod · 0.45
CountMethod · 0.45
GetQueryResultMethod · 0.45

Tested by

no test coverage detected