Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1042 - trunk/StandAlone


Chronological Thread 
  • From: sparker@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1042 - trunk/StandAlone
  • Date: Thu, 4 May 2006 16:43:08 -0600 (MDT)

Author: sparker
Date: Thu May  4 16:43:08 2006
New Revision: 1042

Modified:
   trunk/StandAlone/manta.cc
Log:
No more performance mystery.   Since raygen didn't st the ray colors, it was 
picking up trash,
which caused a slow floating point denorm.  Now we set the flags to ignore 
denorm values (flush
them to zero).

Paul Messmer on the apple performance optimization list helped figure this 
out...

Manta now gets 153 frames per second on 64 element fragments/packets


Modified: trunk/StandAlone/manta.cc
==============================================================================
--- trunk/StandAlone/manta.cc   (original)
+++ trunk/StandAlone/manta.cc   Thu May  4 16:43:08 2006
@@ -59,6 +59,7 @@
 #include <Model/Primitives/Sphere.h>
 #include <Model/TexCoordMappers/UniformMapper.h>
 #include <SCIRun/Core/Thread/Thread.h>
+#include <MantaSSE.h>
 
 #include <strings.h>
 
@@ -162,22 +163,24 @@
   delete this;
 }
 
-//#define MYSTERY
-#ifdef MYSTERY
-bool never = false;
-#endif
-
 int
 main(int argc, char* argv[])
 {
 #ifdef MYSTERY
-  char tmp[4000];
+  char tmp[400];
   if(never){
     sprintf(tmp, "");
   }
 #endif
 #if HAVE_IEEEFP_H
   fpsetmask(FP_X_OFL|FP_X_DZ|FP_X_INV);
+#endif
+
+#ifdef MANTA_SSE
+  // Disables denormal handling and set flush to zero
+  int oldMXCSR = _mm_getcsr(); //read the old MXCSR setting 
+  int newMXCSR = oldMXCSR | 0x8040; // set DAZ and FZ bits 
+  _mm_setcsr( newMXCSR ); //write the new MXCSR setting to the MXCSR 
 #endif
 
   // Copy args into a vector<string>




  • [MANTA] r1042 - trunk/StandAlone, sparker, 05/04/2006

Archive powered by MHonArc 2.6.16.

Top of page