| 317 | } |
| 318 | |
| 319 | void PerformanceCounterViewer::CaptureCounters() |
| 320 | { |
| 321 | if(!m_Ctx.IsCaptureLoaded()) |
| 322 | return; |
| 323 | |
| 324 | PerformanceCounterSelection pcs(m_Ctx, m_SelectedCounters, this); |
| 325 | if(RDDialog::show(&pcs) != QDialog::Accepted) |
| 326 | return; |
| 327 | m_SelectedCounters = pcs.GetSelectedCounters(); |
| 328 | |
| 329 | ANALYTIC_SET(UIFeatures.PerformanceCounters, true); |
| 330 | |
| 331 | bool done = false; |
| 332 | m_Ctx.Replay().AsyncInvoke([this, &done](IReplayController *controller) -> void { |
| 333 | rdcarray<GPUCounter> counters; |
| 334 | counters.resize(m_SelectedCounters.size()); |
| 335 | |
| 336 | rdcarray<CounterDescription> counterDescriptions; |
| 337 | |
| 338 | for(int i = 0; i < m_SelectedCounters.size(); ++i) |
| 339 | { |
| 340 | counters[i] = (GPUCounter)m_SelectedCounters[i]; |
| 341 | counterDescriptions.push_back(controller->DescribeCounter(counters[i])); |
| 342 | } |
| 343 | |
| 344 | rdcarray<CounterResult> results = controller->FetchCounters(counters); |
| 345 | |
| 346 | GUIInvoke::call(this, [this, results, counterDescriptions]() { |
| 347 | m_ItemModel->refresh(counterDescriptions, results); |
| 348 | |
| 349 | ui->counterResults->resizeColumnsToContents(); |
| 350 | }); |
| 351 | |
| 352 | done = true; |
| 353 | }); |
| 354 | |
| 355 | ShowProgressDialog(this, tr("Capturing counters"), [&done]() -> bool { return done; }); |
| 356 | } |
| 357 | |
| 358 | void PerformanceCounterViewer::OnCaptureClosed() |
| 359 | { |
nothing calls this directly
no test coverage detected