Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r782 - trunk/StandAlone


Chronological Thread 
  • From: sparker@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r782 - trunk/StandAlone
  • Date: Tue, 13 Dec 2005 13:23:21 -0700 (MST)

Author: sparker
Date: Tue Dec 13 13:23:21 2005
New Revision: 782

Modified:
   trunk/StandAlone/manta.cc
Log:
Restored printout of full text for -bench flag
If you want just the framerate, use -quietbench


Modified: trunk/StandAlone/manta.cc
==============================================================================
--- trunk/StandAlone/manta.cc   (original)
+++ trunk/StandAlone/manta.cc   Tue Dec 13 13:23:21 2005
@@ -77,18 +77,19 @@
 
 class BenchHelper {
 public:
-  BenchHelper(MantaInterface* rtrt, long numFrames);
+  BenchHelper(MantaInterface* rtrt, long numFrames, bool verbose);
   void start(int, int);
   void stop(int, int);
        
 private:
-               MantaInterface* rtrt;
+  MantaInterface* rtrt;
   double startTime;
   long numFrames;
+  bool verbose;
 };
 
-BenchHelper::BenchHelper(MantaInterface* rtrt, long numFrames)
-: rtrt(rtrt), numFrames(numFrames)
+BenchHelper::BenchHelper(MantaInterface* rtrt, long numFrames, bool verbose)
+  : rtrt(rtrt), numFrames(numFrames), verbose(verbose)
 {
 }
 
@@ -101,9 +102,11 @@
 {
   double dt = Time::currentSeconds()-startTime;
   double fps = numFrames/dt;
-  // cout << "Benchmark completed in " << dt << " seconds (" << numFrames << 
" frames, " << fps << " frames per second)\n";
-  std::cout << fps << std::endl;
-       rtrt->finish();
+  if(verbose)
+    cout << "Benchmark completed in " << dt << " seconds (" << numFrames << 
" frames, " << fps << " frames per second)\n";
+  else
+    std::cout << fps << std::endl;
+  rtrt->finish();
   delete this;
 }
 
@@ -146,26 +149,29 @@
     bool channelCreated=false;
     bool stereo = false;
     bool haveUI = false;
-               bool compute_bb_camera = false;
+    bool compute_bb_camera = false;
 
     int argc = static_cast<int>(args.size());
     for(int i=0;i<argc;i++){
       string arg = args[i];
       if(arg == "-help"){
-                               usage(rtrt);
-      } else if(arg == "-bench"){
-                               long numFrames = 100;
-                               long warmup = 10;
-                               if(getLongArg(i, args, numFrames)){
-                                       getLongArg(i, args, warmup);
-                               }
-                               BenchHelper* b = new BenchHelper(rtrt, 
numFrames);
-                               // Ask for two callbacks, one at frame 
"warmup", and one at
-                               // frame warmup+numFrames
-                               
rtrt->addOneShotCallback(MantaInterface::Absolute, warmup,
-                                                                             
                                                   Callback::create(b, 
&BenchHelper::start));
-                               
rtrt->addOneShotCallback(MantaInterface::Absolute, warmup+numFrames,
-                                                                             
                                                   Callback::create(b, 
&BenchHelper::stop));
+        usage(rtrt);
+      } else if(arg == "-bench" || arg == "-quietbench"){
+        bool verbose = true;
+        if(arg == "-quietbench")
+          verbose = false;
+        long numFrames = 100;
+        long warmup = 10;
+        if(getLongArg(i, args, numFrames)){
+          getLongArg(i, args, warmup);
+        }
+        BenchHelper* b = new BenchHelper(rtrt, numFrames, verbose);
+        // Ask for two callbacks, one at frame "warmup", and one at
+        // frame warmup+numFrames
+        rtrt->addOneShotCallback(MantaInterface::Absolute, warmup,
+                                 Callback::create(b, &BenchHelper::start));
+        rtrt->addOneShotCallback(MantaInterface::Absolute, warmup+numFrames,
+                                 Callback::create(b, &BenchHelper::stop));
       } else if(arg == "-camera"){
                                string s;
                                if(!getStringArg(i, args, s))




  • [MANTA] r782 - trunk/StandAlone, sparker, 12/13/2005

Archive powered by MHonArc 2.6.16.

Top of page