Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r1994 - trunk/Model/Instances


Chronological Thread 
  • From: boulos@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [Manta] r1994 - trunk/Model/Instances
  • Date: Mon, 14 Jan 2008 16:29:49 -0700 (MST)

Author: boulos
Date: Mon Jan 14 16:29:48 2008
New Revision: 1994

Modified:
   trunk/Model/Instances/Instance.cc
Log:
Model/Instances/Instance.cc

 Properly wrapping SSE code with ifdef SSE (thanks James for noticing the 
build break)


Modified: trunk/Model/Instances/Instance.cc
==============================================================================
--- trunk/Model/Instances/Instance.cc   (original)
+++ trunk/Model/Instances/Instance.cc   Mon Jan 14 16:29:48 2008
@@ -146,6 +146,7 @@
     bbox.extendByPoint(transform.multiply_point(ibox.getCorner(i)));
 }
 
+#ifdef MANTA_SSE
 // Compute 4 points at once
 inline void MultiplyPointSSE(const AffineTransform& t,
                              __m128 x_in,
@@ -189,6 +190,7 @@
   z_out  = _mm_add_ps(z_out, _mm_mul_ps(_mm_set1_ps(t.mat[2][1]), y_in));
   z_out  = _mm_add_ps(z_out, _mm_mul_ps(_mm_set1_ps(t.mat[2][2]), z_in));
 }
+#endif
 
 void Instance::intersect(const RenderContext& context, RayPacket& rays) const
 {
@@ -231,12 +233,13 @@
     Real ilength = 1/length; \
     scales.set(i, ilength);                  \
     instance_rays.setRay(i, o, dir*ilength); \
-    instance_rays.overrideMinT(i, rays.getMinT(i)*length); \
+    instance_rays.overrideMinT(i, rays.getMinT(i)*length);
 
 #define SCALAR_KERNEL_NONCONSTANT_ORIGIN \
     Vector o = transform_inv.multiply_point(rays.getOrigin(i)); \
-    SCALAR_KERNEL_CONSTANT_ORIGIN ; \
+    SCALAR_KERNEL_CONSTANT_ORIGIN;
 
+#ifdef MANTA_SSE
 
 #define SSE_KERNEL_CONSTANT_ORIGIN \
     __m128 dir_x, dir_y, dir_z;                                              
 \
@@ -265,7 +268,7 @@
     _mm_store_ps(&(instance_rays.data->direction[2][i]), dir_z);             
 \
                                                                              
 \
     __m128 new_t = _mm_mul_ps(length, _mm_load_ps(&(rays.data->minT[i])));   
 \
-    _mm_store_ps(&(instance_rays.data->minT[i]), new_t);                     
 \
+    _mm_store_ps(&(instance_rays.data->minT[i]), new_t);
 
 #define SSE_KERNEL_NONCONSTANT_ORIGIN \
     __m128 org_x, org_y, org_z;                                              
 \
@@ -274,7 +277,8 @@
                      _mm_load_ps(&(rays.data->origin[1][i])),                
 \
                      _mm_load_ps(&(rays.data->origin[2][i])),                
 \
                      org_x, org_y, org_z);                                   
 \
-    SSE_KERNEL_CONSTANT_ORIGIN;                                              
 \
+    SSE_KERNEL_CONSTANT_ORIGIN;
+#endif // MANTA_SSE
 
 #ifdef MANTA_SSE
     int b = (rays.rayBegin + 3) & (~3);




  • [Manta] r1994 - trunk/Model/Instances, boulos, 01/14/2008

Archive powered by MHonArc 2.6.16.

Top of page