Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1257 - in trunk: Core/Math Model/Groups


Chronological Thread 
  • From: boulos@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1257 - in trunk: Core/Math Model/Groups
  • Date: Mon, 11 Dec 2006 17:53:24 -0700 (MST)

Author: boulos
Date: Mon Dec 11 17:53:23 2006
New Revision: 1257

Modified:
   trunk/Core/Math/SSEDefs.cc
   trunk/Model/Groups/DynBVH.cc
   trunk/Model/Groups/DynBVH.h
Log:
Ensuring that DynBVH code works and compiles even
without MANTA_SSE defined.  Similarly, fixing the
same issue in SSEDefs.cc.



Modified: trunk/Core/Math/SSEDefs.cc
==============================================================================
--- trunk/Core/Math/SSEDefs.cc  (original)
+++ trunk/Core/Math/SSEDefs.cc  Mon Dec 11 17:53:23 2006
@@ -1,5 +1,7 @@
 
 #include <Core/Math/SSEDefs.h>
+
+#ifdef MANTA_SSE
 #include <iostream>
 
 namespace std {
@@ -24,3 +26,4 @@
   }
 #endif
 }
+#endif // MANTA_SSE

Modified: trunk/Model/Groups/DynBVH.cc
==============================================================================
--- trunk/Model/Groups/DynBVH.cc        (original)
+++ trunk/Model/Groups/DynBVH.cc        Mon Dec 11 17:53:23 2006
@@ -10,7 +10,11 @@
 const float BVH_C_isec = 10.f;
 const float BVH_C_trav = 10.f;
 
+#ifdef MANTA_SSE
 #define USE_DYNBVH_PORTS 1
+#else
+#define USE_DYNBVH_PORTS 0
+#endif
 
 void DynBVH::intersect(const RenderContext& context, RayPacket& rays) const
 {
@@ -314,7 +318,7 @@
 #else
     for (int i = rays.begin(); i < rays.end(); i++) {
       float tmin = 1e-5f;
-      float tmax = rays.getMinT(ray);
+      float tmax = rays.getMinT(i);
 
       for (int c = 0; c < 3; c++) {
         float t0 = (box[0][c] - rays.getOrigin(i,c)) * 
rays.getInverseDirection(i,c);
@@ -327,7 +331,7 @@
       }
       if (tmin <= tmax) {  // valid intersection
         *out_tmin = tmin;
-        return ray;
+        return i;
       }
 
       if (i == rays.begin()) {
@@ -363,7 +367,7 @@
 
           tmin_frustum = (tmin_frustum < a) ? a : tmin_frustum;
           tmax_frustum = (tmax_frustum > b) ? b : tmax_frustum;
-          }
+        }
 
         // frustum exit
         if (tmin_frustum > tmax_frustum) {
@@ -371,6 +375,7 @@
         }
       }
     }
+    return rays.end();
 #endif
 }
 
@@ -658,6 +663,7 @@
 
 
 // begin port from actual DynBVH
+#ifdef MANTA_SSE
 void DynBVH::templatedTraverse(const RenderContext& context, RayPacket& 
packet) const {
   struct StackNode {
     int nodeID;
@@ -894,7 +900,6 @@
     if (_mm_movemask_ps(_mm_cmple_ps(t0, t1)) != 0x0)
       return i;
   }
-
   return RayPacket::MaxSize;
 }
 
@@ -972,7 +977,6 @@
     if (_mm_movemask_ps(_mm_cmple_ps(t0, t1)) != 0x0)
       return i + 3;
   }
-
   return firstActive + 3;
 }
 
@@ -1229,3 +1233,4 @@
 
   return firstActive + 3;
 }
+#endif // MANTA_SSE for USE_DYNBVH_PORTS

Modified: trunk/Model/Groups/DynBVH.h
==============================================================================
--- trunk/Model/Groups/DynBVH.h (original)
+++ trunk/Model/Groups/DynBVH.h Mon Dec 11 17:53:23 2006
@@ -128,6 +128,7 @@
                          int axis,
                          BVHCostEval& eval);
 
+#ifdef MANTA_SSE
       // DynBVH ports
       void templatedTraverse(const RenderContext& context, RayPacket& 
packet) const;
 
@@ -148,6 +149,7 @@
                                          const int firstActive,
                                          const BBox& box,
                                          const int signs[3]) const;
+#endif
 
     };
 };




  • [MANTA] r1257 - in trunk: Core/Math Model/Groups, boulos, 12/11/2006

Archive powered by MHonArc 2.6.16.

Top of page