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

Comparing ray/src/rt/rayfifo.c (file contents):
Revision 2.3 by greg, Sat Dec 12 23:08:13 2009 UTC vs.
Revision 2.4 by greg, Sun Dec 13 19:13:04 2009 UTC

# Line 20 | Line 20 | static const char RCSid[] = "$Id$";
20   *  is desired, a negative value may be returned.
21   *
22   *  The ray_fifo_in() call takes a ray that has been initialized in
23 < *  the same manner as for the ray_trace() call, i.e., the origin,
24 < *  direction, and maximum length have been assigned. The ray number
25 < *  will be set according to the number of rays traced since the
23 > *  the same manner as for the ray_pqueue() call, i.e., rayorigin()
24 > *  has been called and the origin, direction and maximum distance
25 > *  have all been assigned.  However, the ray number will be reset
26 > *  by ray_fifo_in() according to the number of rays traced since the
27   *  last call to ray_fifo_flush().  This final call completes all
28   *  pending ray calculations and frees the FIFO buffer.  If any of
29   *  the automatic calls to the ray_fifo_out callback return a
# Line 54 | Line 55 | ray_fifo_growbuf(void) /* double buffer size (or set t
55          int     i;
56  
57          if (r_fifo_buf == NULL)
58 <                r_fifo_len = 1<<4;
58 >                r_fifo_len = 1<<5;
59          else
60                  r_fifo_len <<= 1;
61                                                  /* allocate new */
# Line 84 | Line 85 | ray_fifo_push(         /* send finished ray to output (or que
85                  error(INTERNAL, "unexpected ray number in ray_fifo_push()");
86  
87          if (r->rno > r_fifo_start) {            /* insert into output queue */
88 <                if (r->rno - r_fifo_start >= r_fifo_len)
88 >                while (r->rno - r_fifo_start >= r_fifo_len)
89                          ray_fifo_growbuf();     /* need more space */
90                  *r_fifo(r->rno) = *r;
91                  if (r->rno >= r_fifo_end)
# Line 125 | Line 126 | ray_fifo_in(           /* add ray to FIFO */
126                  rval += rv;
127          }
128                                                  /* queue ray */
128        rayorigin(r, PRIMARY, NULL, NULL);
129          r->rno = r_fifo_next++;
130          if ((rv = ray_pqueue(r)) < 0)
131                  {--incall; return(-1);}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines