| 45 | } |
| 46 | |
| 47 | void 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 | |
| 72 | int32 ProfilerGPU::EventBuffer::Add(const Event& e) |
| 73 | { |
no test coverage detected