Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1123 - trunk/Engine/PixelSamplers


Chronological Thread 
  • From: bigler@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1123 - trunk/Engine/PixelSamplers
  • Date: Tue, 20 Jun 2006 15:45:07 -0600 (MDT)

Author: bigler
Date: Tue Jun 20 15:45:07 2006
New Revision: 1123

Modified:
   trunk/Engine/PixelSamplers/SingleSampler.cc
Log:

This change in code seems to make the weird pixel offset go away.
Before you would see pixel locations look like this:

rays[0] = eye(0), loc(-0.96875, -0.96875)
rays[1] = eye(0), loc(-0.96875, -0.96875)
rays[2] = eye(0), loc(-0.84375, -0.96875)
rays[3] = eye(0), loc(-0.78125, -0.96875)

intead of:

rays[0] = eye(0), loc(-0.96875, -0.96875)
rays[1] = eye(0), loc(-0.90625, -0.96875)
rays[2] = eye(0), loc(-0.84375, -0.96875)
rays[3] = eye(0), loc(-0.78125, -0.96875)

I tried changing the last offset from 0 to -ci.xscale, but that seemed
to change the first two values instead of the just the last.  Very
weird stuff going on.

Anyway, I changed how the cascading offsets were loaded and it seemed
to make GCC happy.


Modified: trunk/Engine/PixelSamplers/SingleSampler.cc
==============================================================================
--- trunk/Engine/PixelSamplers/SingleSampler.cc (original)
+++ trunk/Engine/PixelSamplers/SingleSampler.cc Tue Jun 20 15:45:07 2006
@@ -78,7 +78,15 @@
       int eye = fragment.getWhichEye(b);
       
 #if MANTA_SSE
-      __m128 vec_xscale_cascade = _mm_set_ps(ci.xscale*3, ci.xscale*2, 
ci.xscale, 0);
+      // The code used to load in the values using _mm_set_ps, but
+      // that seemed to be broken for certain gcc compilers.  Stuffing
+      // the values into cascade4 first and then loading it, seems to
+      // work.
+      MANTA_ALIGN(16) float cascade4[4] = {0.0f,
+                                           ci.xscale,
+                                           ci.xscale+ci.xscale,
+                                           ci.xscale+ci.xscale+ci.xscale};
+      __m128 vec_xscale_cascade = _mm_load_ps(cascade4);
       __m128 vec_px = _mm_add_ps(_mm_set1_ps(px), vec_xscale_cascade);
       __m128 vec_py = _mm_set1_ps(py);
       __m128i vec_eye = _mm_set1_epi32(eye);




  • [MANTA] r1123 - trunk/Engine/PixelSamplers, bigler, 06/20/2006

Archive powered by MHonArc 2.6.16.

Top of page