From b34c6756b2e1abb6be20770f43f44d0b5e90f677 Mon Sep 17 00:00:00 2001 From: Peter Lohrmann Date: Wed, 10 Jul 2013 11:08:14 -0400 Subject: [PATCH] qapitrace: Add option to replay in singlethreaded mode Some traces fail to replay (hang) if glretrace does not have --singelthread on the command line, this change makes a UI option available. --- gui/mainwindow.cpp | 6 ++++++ gui/retracer.cpp | 15 ++++++++++++++ gui/retracer.h | 4 ++++ gui/ui/retracerdialog.ui | 45 +++++++++++++++++++++++++++++++++++++++- 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 2891863..23729cd 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -196,6 +196,9 @@ void MainWindow::replayStart() dlgUi.errorCheckCB->setChecked( !m_retracer->isBenchmarking()); + dlgUi.singlethreadCB->setChecked( + m_retracer->isSinglethread()); + if (dlg.exec() == QDialog::Accepted) { m_retracer->setDoubleBuffered( dlgUi.doubleBufferingCB->isChecked()); @@ -203,6 +206,9 @@ void MainWindow::replayStart() m_retracer->setBenchmarking( !dlgUi.errorCheckCB->isChecked()); + m_retracer->setSinglethread( + dlgUi.singlethreadCB->isChecked()); + m_retracer->setProfiling(false, false, false); replayTrace(false, false); diff --git a/gui/retracer.cpp b/gui/retracer.cpp index 2de9d23..cb0bad3 100644 --- a/gui/retracer.cpp +++ b/gui/retracer.cpp @@ -130,6 +130,7 @@ Retracer::Retracer(QObject *parent) : QThread(parent), m_benchmarking(false), m_doubleBuffered(true), + m_singlethread(false), m_captureState(false), m_captureCall(0), m_profileGpu(false), @@ -184,6 +185,16 @@ void Retracer::setDoubleBuffered(bool db) m_doubleBuffered = db; } +bool Retracer::isSinglethread() const +{ + return m_singlethread; +} + +void Retracer::setSinglethread(bool singlethread) +{ + m_singlethread = singlethread; +} + bool Retracer::isProfilingGpu() const { return m_profileGpu; @@ -281,6 +292,10 @@ void Retracer::run() return; } + if (m_singlethread) { + arguments << QLatin1String("--singlethread"); + } + if (m_captureState) { arguments << QLatin1String("-D"); arguments << QString::number(m_captureCall); diff --git a/gui/retracer.h b/gui/retracer.h index 915b97f..bb53469 100644 --- a/gui/retracer.h +++ b/gui/retracer.h @@ -31,6 +31,9 @@ public: bool isDoubleBuffered() const; void setDoubleBuffered(bool db); + bool isSinglethread() const; + void setSinglethread(bool singlethread); + bool isProfilingGpu() const; bool isProfilingCpu() const; bool isProfilingPixels() const; @@ -63,6 +66,7 @@ private: trace::API m_api; bool m_benchmarking; bool m_doubleBuffered; + bool m_singlethread; bool m_captureState; bool m_captureThumbnails; qlonglong m_captureCall; diff --git a/gui/ui/retracerdialog.ui b/gui/ui/retracerdialog.ui index 8df9960..33ae85d 100644 --- a/gui/ui/retracerdialog.ui +++ b/gui/ui/retracerdialog.ui @@ -10,7 +10,7 @@ 0 0 286 - 94 + 125 @@ -100,6 +100,49 @@ + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Singlethread + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + -- 2.43.0