| 93 | } |
| 94 | |
| 95 | int32 ProfilerGPU::BeginEvent(const Char* name) |
| 96 | { |
| 97 | auto context = GPUDevice::Instance->GetMainContext(); |
| 98 | #if GPU_ALLOW_PROFILE_EVENTS |
| 99 | if (EventsEnabled) |
| 100 | context->EventBegin(name); |
| 101 | #endif |
| 102 | if (!Enabled) |
| 103 | return -1; |
| 104 | |
| 105 | Event e; |
| 106 | e.Name = name; |
| 107 | e.Stats = RenderStatsData::Counter; |
| 108 | e.Query = context->BeginQuery(GPUQueryType::Timer); |
| 109 | e.Depth = _depth++; |
| 110 | e.QueryActive = true; |
| 111 | |
| 112 | auto& buffer = Buffers[CurrentBuffer]; |
| 113 | const auto index = buffer.Add(e); |
| 114 | return index; |
| 115 | } |
| 116 | |
| 117 | void ProfilerGPU::EndEvent(int32 index) |
| 118 | { |
nothing calls this directly
no test coverage detected