]> git.cworth.org Git - apitrace/commitdiff
qapitrace: Add option to replay in singlethreaded mode
authorPeter Lohrmann <PeterL@valvesoftware.com>
Wed, 10 Jul 2013 15:08:14 +0000 (11:08 -0400)
committerJosé Fonseca <jfonseca@vmware.com>
Sat, 20 Jul 2013 12:51:36 +0000 (13:51 +0100)
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
gui/retracer.cpp
gui/retracer.h
gui/ui/retracerdialog.ui

index 2891863a4a0f87bbd147febdf916116870ec7b63..23729cd6d274f7f7b920fb2278286b13dcc6a05c 100644 (file)
@@ -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);
index 2de9d23ee849de85f12c6cbf51461750ba7edf68..cb0bad35abcfb5284a79ee971a7be9f679a01c28 100644 (file)
@@ -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);
index 915b97fe0252cf86d01d74ee7a02df775eba2a16..bb534698661bd08adeceecaeef5ec5e51e61b6ed 100644 (file)
@@ -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;
index 8df9960eb40dce9060d967f50773397213c64644..33ae85d99e3695818e9c360abea5f1979e57b5c9 100644 (file)
@@ -10,7 +10,7 @@
     <x>0</x>
     <y>0</y>
     <width>286</width>
-    <height>94</height>
+    <height>125</height>
    </rect>
   </property>
   <property name="windowTitle">
      </item>
     </layout>
    </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_3">
+     <item>
+      <spacer name="horizontalSpacer_5">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QCheckBox" name="singlethreadCB">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>Singlethread</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_6">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
    <item>
     <widget class="QDialogButtonBox" name="buttonBox">
      <property name="orientation">