Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1448 - in trunk: CMake Core/Util Engine/Renderers StandAlone


Chronological Thread 
  • From: bigler@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1448 - in trunk: CMake Core/Util Engine/Renderers StandAlone
  • Date: Fri, 6 Jul 2007 09:57:59 -0600 (MDT)

Author: bigler
Date: Fri Jul  6 09:57:57 2007
New Revision: 1448

Modified:
   trunk/CMake/CheckSSE.cmake
   trunk/CMake/FindX11andGL.cmake
   trunk/Core/Util/AlignedAllocator.cc
   trunk/Engine/Renderers/Noise.cc
   trunk/StandAlone/noisegen.cc
Log:

CMake/CheckSSE.cmake

  Disable SSE on Cygwin, because of lack of GCC 4.x compiler and
  global variable initialization bug.

CMake/FindX11andGL.cmake

  Link against .a libraries when not building shared libraries.

Core/Util/AlignedAllocator.cc

  Silently ignore aligned allocation for cygwin.

Engine/Renderers/Noise.cc
StandAlone/noisegen.cc

  Fixes for non SSE builds.


Modified: trunk/CMake/CheckSSE.cmake
==============================================================================
--- trunk/CMake/CheckSSE.cmake  (original)
+++ trunk/CMake/CheckSSE.cmake  Fri Jul  6 09:57:57 2007
@@ -69,5 +69,10 @@
 
 ENDIF(NOT NOT_MANTA_SSE)
 
-
+IF (CYGWIN)
+  IF (MANTA_SSE)
+    MESSAGE("SSE is broken on Cygwin, because of global variable 
initialization and the lack of a GCC 4.x compiler.  SSE will be disabled for 
now.")
+    SET(MANTA_SSE FALSE CACHE BOOL "SSE broken on Cygwin." FORCE)
+  ENDIF (MANTA_SSE)
+ENDIF (CYGWIN)
 

Modified: trunk/CMake/FindX11andGL.cmake
==============================================================================
--- trunk/CMake/FindX11andGL.cmake      (original)
+++ trunk/CMake/FindX11andGL.cmake      Fri Jul  6 09:57:57 2007
@@ -20,8 +20,13 @@
 
 IF (CYGWIN)
   SET (OPENGL_INCLUDE_DIR               /usr/X11R6/include)
-  SET (OPENGL_gl_LIBRARY                /usr/X11R6/lib/libGL.dll)
-  SET (OPENGL_glu_LIBRARY               /usr/X11R6/lib/libGLU.dll)
+  IF (BUILD_SHARED_LIBS)
+    SET (OPENGL_gl_LIBRARY              /usr/X11R6/bin/libGL.dll)
+    SET (OPENGL_glu_LIBRARY             /usr/X11R6/bin/libGLU.dll)
+  ELSE (BUILD_SHARED_LIBS)
+    SET (OPENGL_gl_LIBRARY              /usr/X11R6/lib/libGL.dll.a)
+    SET (OPENGL_glu_LIBRARY             /usr/X11R6/lib/libGLU.dll.a)
+  ENDIF (BUILD_SHARED_LIBS)
 ENDIF (CYGWIN)
 
 INCLUDE (${CMAKE_ROOT}/Modules/FindOpenGL.cmake)

Modified: trunk/Core/Util/AlignedAllocator.cc
==============================================================================
--- trunk/Core/Util/AlignedAllocator.cc (original)
+++ trunk/Core/Util/AlignedAllocator.cc Fri Jul  6 09:57:57 2007
@@ -35,7 +35,7 @@
 void* Manta::allocateAligned(size_t size, size_t alignment)
 {
   void* memptr;
-#ifdef __APPLE__
+#if defined( __APPLE__) || defined (__CYGWIN__)
   int return_code = ( ((memptr = malloc(size)) == NULL) ? ENOMEM : 0);
 #else
   int return_code = posix_memalign(&memptr, alignment, size);

Modified: trunk/Engine/Renderers/Noise.cc
==============================================================================
--- trunk/Engine/Renderers/Noise.cc     (original)
+++ trunk/Engine/Renderers/Noise.cc     Fri Jul  6 09:57:57 2007
@@ -34,6 +34,11 @@
       throw IllegalArgument("Moire", i, args);
     }
   }
+#ifndef MANTA_SSE
+  if (sse) {
+    sse = false;
+  }
+#endif
 }
 
 Noise::~Noise()
@@ -58,6 +63,7 @@
   float phase = context.frameState->frameTime * rate;
   RayPacketData* data = rays.data;
   if(sse){
+#ifdef MANTA_SSE
     __m128 z = _mm_set1_ps(phase);
     for(int i=rays.begin();i<rays.end();i+=4){
       __m128 x = _mm_mul_ps(_mm_load_ps(&data->image[0][i]), 
_mm_set1_ps(25));
@@ -68,6 +74,7 @@
       _mm_store_ps(&data->color[1][i], gray);
       _mm_store_ps(&data->color[2][i], gray);
     }
+#endif
   } else {
     for(int i=rays.begin();i<rays.end();i++){
       float x = data->image[0][i]*25;

Modified: trunk/StandAlone/noisegen.cc
==============================================================================
--- trunk/StandAlone/noisegen.cc        (original)
+++ trunk/StandAlone/noisegen.cc        Fri Jul  6 09:57:57 2007
@@ -16,9 +16,13 @@
   for(int y = 0; y < yres; ++y)
     for(int x = 0; x < xres; ++x)
       {
+#ifdef MANTA_SSE
         __m128 sval = ScalarNoiseSSE(_mm_set_ps1((float)x/10), 
_mm_set_ps1((float)y/10), _mm_setzero_ps());
         //        cout << "sval = "<<sval<<"\n";
         float val = simd_component(sval, 0);
+#else
+        float val = ScalarNoise(Vector((float)x/10, (float)y/10, 0));
+#endif
         RGB8Pixel pixel;
         //val = fabsf(val);
         val = (val+1)/2;




  • [MANTA] r1448 - in trunk: CMake Core/Util Engine/Renderers StandAlone, bigler, 07/06/2007

Archive powered by MHonArc 2.6.16.

Top of page