Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1156 - trunk/Engine/PixelSamplers


Chronological Thread 
  • From: boulos@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1156 - trunk/Engine/PixelSamplers
  • Date: Mon, 24 Jul 2006 10:52:51 -0600 (MDT)

Author: boulos
Date: Mon Jul 24 10:52:50 2006
New Revision: 1156

Modified:
   trunk/Engine/PixelSamplers/SingleSampler.cc
Log:
Fix for MANTA_SSE path when Fragment::MaxSize is
greater than RayPacket::MaxSize.


Modified: trunk/Engine/PixelSamplers/SingleSampler.cc
==============================================================================
--- trunk/Engine/PixelSamplers/SingleSampler.cc (original)
+++ trunk/Engine/PixelSamplers/SingleSampler.cc Mon Jul 24 10:52:50 2006
@@ -76,7 +76,7 @@
       Real px = fragment.getX(b)*ci.xscale+ci.xoffset;
       Real py = fragment.getY(b)*ci.yscale+ci.yoffset;
       int eye = fragment.getWhichEye(b);
-      
+
 #if MANTA_SSE
       // The code used to load in the values using _mm_set_ps, but
       // that seemed to be broken for certain gcc compilers.  Stuffing
@@ -94,9 +94,9 @@
       int e = size&(~3);
       __m128 vec_xscale4 = _mm_set1_ps(ci.xscale*4);
       for(int i=0;i<e;i+=4){
-        _mm_store_si128((__m128i*)&data->whichEye[f+i], vec_eye);
-        _mm_store_ps(&data->image[0][f+i], vec_px);
-        _mm_store_ps(&data->image[1][f+i], vec_py);
+        _mm_store_si128((__m128i*)&data->whichEye[i], vec_eye);
+        _mm_store_ps(&data->image[0][i], vec_px);
+        _mm_store_ps(&data->image[1][i], vec_py);
         vec_px = _mm_add_ps(vec_px, vec_xscale4);
       }
 #else
@@ -118,11 +118,11 @@
       __m128 vec_xscale = _mm_set1_ps(ci.xscale);
       __m128 vec_yscale = _mm_set1_ps(ci.yscale);
       for(int i=0;i<e;i+=4) {
-        _mm_store_si128((__m128i*)&data->whichEye[f+i], 
_mm_load_si128((__m128i*)&fragment.whichEye[f+i]));
+        _mm_store_si128((__m128i*)&data->whichEye[i], 
_mm_load_si128((__m128i*)&fragment.whichEye[f+i]));
         __m128 fx = 
_mm_cvtepi32_ps(_mm_load_si128((__m128i*)&fragment.pixel[0][f+i]));
-        _mm_store_ps(&data->image[0][f+i], _mm_add_ps(_mm_mul_ps(fx, 
vec_xscale), vec_xoffset));
+        _mm_store_ps(&data->image[0][i], _mm_add_ps(_mm_mul_ps(fx, 
vec_xscale), vec_xoffset));
         __m128 fy = 
_mm_cvtepi32_ps(_mm_load_si128((__m128i*)&fragment.pixel[1][f+i]));
-        _mm_store_ps(&data->image[1][f+i], _mm_add_ps(_mm_mul_ps(fy, 
vec_yscale), vec_yoffset));
+        _mm_store_ps(&data->image[1][i], _mm_add_ps(_mm_mul_ps(fy, 
vec_yscale), vec_yoffset));
       }
 #else
       int e = 0;
@@ -133,7 +133,7 @@
         rays.setPixel(i, fragment.getWhichEye(f+i), px, py);
       }
     }
-    
+
     // Trace the rays.  The results will automatically go into the fragment
     context.renderer->traceEyeRays(context, rays);
 




  • [MANTA] r1156 - trunk/Engine/PixelSamplers, boulos, 07/24/2006

Archive powered by MHonArc 2.6.16.

Top of page