ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/RtraceSimulManager.cpp
(Generate patch)

Comparing ray/src/rt/RtraceSimulManager.cpp (file contents):
Revision 2.6 by greg, Tue Apr 30 23:16:23 2024 UTC vs.
Revision 2.10 by greg, Tue Jul 2 23:54:16 2024 UTC

# Line 117 | Line 117 | RadSimulManager::ThreadsAvailable() const
117   // Global pointer to simulation manager for trace call-back (only one)
118   static const RtraceSimulManager *       ourRTsimMan = NULL;
119  
120 < void    // static call-back
120 > // Call-back for trace output
121 > void
122   RtraceSimulManager::RTracer(RAY *r)
123   {
124          (*ourRTsimMan->traceCall)(r, ourRTsimMan->tcData);
# Line 216 | Line 217 | RtraceSimulManager::EnqueueBundle(const FVECT orig_dir
217                  return -1;
218  
219          if (castonly && !cookedCall)
220 <                error(CONSISTENCY, "EnqueueBundle() called in castonly mode without cookedCall");
220 >                error(INTERNAL, "EnqueueBundle() called in castonly mode without cookedCall");
221  
222          if (!UpdateMode())              // update rendering mode if requested
223                  return -1;
224  
225 +        if (rID0 && curFlags&RTdoFIFO)
226 +                error(INTERNAL, "Ray number assignment unsupported with FIFO");
227 +
228          while (n-- > 0) {               // queue each ray
229                  VCOPY(res.rorg, orig_direc[0]);
230                  VCOPY(res.rdir, orig_direc[1]);
231                  orig_direc += 2;
232                  rayorigin(&res, PRIMARY, NULL, NULL);
233 <                if (rID0) res.rno = rID0++;
230 <                else res.rno = ++lastRayID;
233 >                res.rno = rID0 ? (lastRayID = rID0++) : ++lastRayID;
234                  if (curFlags & RTimmIrrad)
235                          res.revf = rayirrad;
236                  else if (castonly)
237                          res.revf = raycast;
238                  double  d = normalize(res.rdir);
239                  bool    sendRes = (cookedCall != NULL);
240 <                if (d > 0) {            // direction vector is valid?
240 >                if (d > .0) {           // direction vector is valid?
241                          if (curFlags & RTlimDist)
242                                  res.rmax = d;
243 <                        if (curFlags & RTdoFIFO) {
244 <                                ray_fifo_in(&res);
243 >                        if (((curFlags&RTdoFIFO) != 0) & (ray_pnprocs > 0)) {
244 >                                if (ray_fifo_in(&res) < 0)
245 >                                        return -1;
246                                  sendRes = false;
247                          } else
248                                  sendRes &= ProcessRay(&res);
# Line 257 | Line 261 | RtraceSimulManager::EnqueueBundle(const FVECT orig_dir
261   int
262   RtraceSimulManager::FlushQueue()
263   {
264 <        if (curFlags & RTdoFIFO)
265 <                return ray_fifo_flush();
266 <
264 >        if (curFlags & RTdoFIFO) {
265 >                if (ray_pnprocs)
266 >                        return ray_fifo_flush();
267 >                return 0;
268 >        }
269          int     nsent = 0;
270          RAY     res;
271  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines