Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r1904 - in trunk: CMake Model/Groups


Chronological Thread 
  • From: bigler@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [Manta] r1904 - in trunk: CMake Model/Groups
  • Date: Tue, 4 Dec 2007 11:06:01 -0700 (MST)

Author: bigler
Date: Tue Dec  4 11:06:00 2007
New Revision: 1904

Modified:
   trunk/CMake/CompilerInfo.cmake
   trunk/Model/Groups/KDTree.cc
   trunk/Model/Groups/KDTree.h
Log:
CMake/CompilerInfo.cmake

  Add the NOMINMAX preprossor defninition.  This gets rid of microsoft
  "#define min" nonsense.

Model/Groups/KDTree.cc
Model/Groups/KDTree.h

  If using Visual Studio don't compile KDTree with SSE.


Modified: trunk/CMake/CompilerInfo.cmake
==============================================================================
--- trunk/CMake/CompilerInfo.cmake      (original)
+++ trunk/CMake/CompilerInfo.cmake      Tue Dec  4 11:06:00 2007
@@ -47,6 +47,8 @@
   SET(USING_WINDOWS_CL TRUE)
   # We should set this macro as well to get our nice trig functions
   ADD_DEFINITIONS(-D_USE_MATH_DEFINES)
+  # Microsoft does some stupid things like #define min and max.
+  ADD_DEFINITIONS(-DNOMINMAX)
 ENDIF(CMAKE_C_COMPILER MATCHES ${MANTA_COMPILER_NAME_REGEXPR}
   AND CMAKE_CXX_COMPILER MATCHES ${MANTA_COMPILER_NAME_REGEXPR})
 # Do some error checking

Modified: trunk/Model/Groups/KDTree.cc
==============================================================================
--- trunk/Model/Groups/KDTree.cc        (original)
+++ trunk/Model/Groups/KDTree.cc        Tue Dec  4 11:06:00 2007
@@ -18,6 +18,13 @@
 static const int ISEC_COST = 20;
 static const int TRAV_COST = 15;
 
+#ifdef _MSC_VER
+#  ifdef MANTA_SSE
+#    define KDTREE_MANTA_SSE MANTA_SSE
+#    undef MANTA_SSE
+#  endif
+#endif
+
 #ifdef MANTA_SSE
 #define SSE
 #endif
@@ -531,16 +538,24 @@
 #endif
 }
 
+#ifdef MAILBOX
 template<bool COMMON_ORIGIN>
 void KDTree::intersectNode(int nodeID, const RenderContext& context,
                            RayPacket& rays, 
                            const float *const  t_in, 
                            const float *const  t_out, 
                            const int   *const  valid
-#ifdef MAILBOX
                            , Mailbox &mailbox
-#endif
                            ) const
+#else
+template<bool COMMON_ORIGIN>
+void KDTree::intersectNode(int nodeID, const RenderContext& context,
+                           RayPacket& rays, 
+                           const float *const  t_in, 
+                           const float *const  t_out, 
+                           const int   *const  valid
+                           ) const
+#endif
 {
 #ifdef COLLECT_STATS
   ++nTraversals;
@@ -663,17 +678,17 @@
     const int frontChildID = node.childIdx+sign; 
 
     if (front == 0) {
-      intersectNode<COMMON_ORIGIN>(backChildID,context,rays,t_in,t_out,valid
 #ifdef MAILBOX
-          , mailbox
+      
intersectNode<COMMON_ORIGIN>(backChildID,context,rays,t_in,t_out,valid, 
mailbox);
+#else
+      
intersectNode<COMMON_ORIGIN>(backChildID,context,rays,t_in,t_out,valid);
 #endif
-);
     } else if (back == 0) {
-      intersectNode<COMMON_ORIGIN>(frontChildID,context,rays,t_in,t_out,valid
 #ifdef MAILBOX
-          , mailbox
+      
intersectNode<COMMON_ORIGIN>(frontChildID,context,rays,t_in,t_out,valid, 
mailbox);
+#else
+      
intersectNode<COMMON_ORIGIN>(frontChildID,context,rays,t_in,t_out,valid);
 #endif
-);
     } else {
 
       MANTA_ALIGN(16) float new_t_out[RayPacketData::MaxSize+1];

Modified: trunk/Model/Groups/KDTree.h
==============================================================================
--- trunk/Model/Groups/KDTree.h (original)
+++ trunk/Model/Groups/KDTree.h Tue Dec  4 11:06:00 2007
@@ -18,8 +18,15 @@
   {
   public:
 
+#ifdef _MSC_VER
+#  ifdef MANTA_SSE
+#    define KDTREE_MANTA_SSE MANTA_SSE
+#    undef MANTA_SSE
+#  endif
+#endif
 
 #ifdef MANTA_SSE
+
 # define MAILBOX
 
 // must be a power of two...
@@ -161,6 +168,14 @@
     };
     void collectTreeStats(int nodeID, int depth, TreeStats &stats);
   };
-};
+
+#ifdef _MSC_VER
+#  ifdef KDTREE_MANTA_SSE
+#    define MANTA_SSE KDTREE_MANTA_SSE
+#    undef KDTREE_MANTA_SSE
+#  endif
+#endif
+
+} // end namespace Manta
 
 #endif




  • [Manta] r1904 - in trunk: CMake Model/Groups, bigler, 12/04/2007

Archive powered by MHonArc 2.6.16.

Top of page