Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1531 - trunk/Model/Primitives


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1531 - trunk/Model/Primitives
  • Date: Sun, 22 Jul 2007 02:37:45 -0600 (MDT)

Author: abe
Date: Sun Jul 22 02:37:45 2007
New Revision: 1531

Modified:
   trunk/Model/Primitives/WaldTriangle.cc
   trunk/Model/Primitives/WaldTriangle.h
Log:

Added enum to determine scratchpad location of stored values. Other
classes may use WaldTriangle::SCRATCH_LAST to avoid scratch pad
conflicts.

M    Primitives/WaldTriangle.cc
M    Primitives/WaldTriangle.h


Modified: trunk/Model/Primitives/WaldTriangle.cc
==============================================================================
--- trunk/Model/Primitives/WaldTriangle.cc      (original)
+++ trunk/Model/Primitives/WaldTriangle.cc      Sun Jul 22 02:37:45 2007
@@ -159,8 +159,8 @@
 void WaldTriangle::computeTexCoords2(const RenderContext&, RayPacket& rays) 
const
 {
   for(int ray=rays.begin(); ray<rays.end(); ray++) {
-    float a = rays.getScratchpad<float>(0)[ray];
-    float b = rays.getScratchpad<float>(1)[ray];
+    float a = rays.getScratchpad<float>(SCRATCH_U)[ray];
+    float b = rays.getScratchpad<float>(SCRATCH_V)[ray];
     float c = (1.0 - a - b);
 
     const int which = myID*3;
@@ -174,7 +174,7 @@
 }
 
 
-#ifdef MANTA_SSE
+#ifdef SSSMANTA_SSE
 
 //These should be defined in SSEDefs.h, but aren't...
 #define none4(mask) (getmask4( (mask) ) == 0x0)
@@ -300,8 +300,8 @@
 
         const bool hit = rays.hit(i, f, 
mesh->materials[mesh->face_material[myID]], this, this);
         if (hit) {
-          float *u = &rays.getScratchpad<float>(0)[i];
-          float *v = &rays.getScratchpad<float>(1)[i];
+          float *u = &rays.getScratchpad<float>(SCRATCH_U)[i];
+          float *v = &rays.getScratchpad<float>(SCRATCH_V)[i];
           *u = lambda;
           *v = mue;
         }
@@ -348,8 +348,8 @@
 
       rays.hitWithoutTminCheck(ray, mask_test, f, 
mesh->materials[mesh->face_material[myID]], this, this);
 
-      float *u = &rays.getScratchpad<float>(0)[ray];
-      float *v = &rays.getScratchpad<float>(1)[ray];
+      float *u = &rays.getScratchpad<float>(SCRATCH_U)[ray];
+      float *v = &rays.getScratchpad<float>(SCRATCH_V)[ray];
 //       int *which = rays.getScratchpad<int*>(2)[ray];
 
       store44(u, mask4(mask_test, lambda, load44(u)));
@@ -407,8 +407,8 @@
 
         const bool hit = rays.hit(i, f, 
mesh->materials[mesh->face_material[myID]], this, this);
         if (hit) {
-          float *u = &rays.getScratchpad<float>(0)[i];
-          float *v = &rays.getScratchpad<float>(1)[i];
+          float *u = &rays.getScratchpad<float>(SCRATCH_U)[i];
+          float *v = &rays.getScratchpad<float>(SCRATCH_V)[i];
           *u = lambda;
           *v = mue;
         }
@@ -474,8 +474,8 @@
 
       const bool hit = rays.hit(i, f, 
mesh->materials[mesh->face_material[myID]], this, this);
       if (hit) {
-        float *u = &rays.getScratchpad<float>(0)[i];
-        float *v = &rays.getScratchpad<float>(1)[i];
+        float *u = &rays.getScratchpad<float>(SCRATCH_U)[i];
+        float *v = &rays.getScratchpad<float>(SCRATCH_V)[i];
         *u = lambda;
         *v = mue;
       }
@@ -488,8 +488,8 @@
   if (mesh->hasVertexNormals()) {
     for(int ray=rays.begin(); ray<rays.end(); ray++) {
 
-      const float a = rays.getScratchpad<float>(0)[ray];
-      const float b = rays.getScratchpad<float>(1)[ray];
+      const float a = rays.getScratchpad<float>(SCRATCH_U)[ray];
+      const float b = rays.getScratchpad<float>(SCRATCH_V)[ray];
       const float c = (1.0 - a - b);
 
       const Vector &n0 = mesh->vertexNormals[mesh->normal_indices[myID*3+0]];

Modified: trunk/Model/Primitives/WaldTriangle.h
==============================================================================
--- trunk/Model/Primitives/WaldTriangle.h       (original)
+++ trunk/Model/Primitives/WaldTriangle.h       Sun Jul 22 02:37:45 2007
@@ -13,6 +13,15 @@
   class WaldTriangle : public Primitive, public TexCoordMapper
   {
   public:
+
+    // Scratch pad structure for Wald Triangle.
+    enum {
+      SCRATCH_U = 0,
+      SCRATCH_V,
+      SCRATCH_LAST // Dependent classes may use this identifier to
+                   // avoid conflicts.
+    };
+    
     WaldTriangle();
     WaldTriangle(Mesh *mesh, unsigned int id);
 




  • [MANTA] r1531 - trunk/Model/Primitives, abe, 07/22/2007

Archive powered by MHonArc 2.6.16.

Top of page