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

Comparing ray/src/rt/pmapdata.h (file contents):
Revision 2.10 by rschregle, Tue May 17 17:39:47 2016 UTC vs.
Revision 2.12 by rschregle, Thu Feb 8 19:55:02 2018 UTC

# Line 28 | Line 28
28   #ifndef PMAPDATA_H
29     #define PMAPDATA_H
30  
31 +   #ifndef NIX
32 +      #if defined(_WIN32) || defined(_WIN64)
33 +         #define NIX 0
34 +      #else
35 +         #define NIX 1
36 +      #endif
37 +   #endif  
38 +
39 +   #if (defined(PMAP_OOC) && !NIX)
40 +      #error "OOC currently only supported on NIX -- tuff luck."
41 +   #endif
42 +
43 +
44     #include "ray.h"  
45     #include "pmaptype.h"
46 +   #include "paths.h"
47     #include "lookup.h"
48     #include <stdint.h>
49  
# Line 39 | Line 53
53     typedef struct {
54        int16    srcIdx;              /* Index of emitting light source */
55                                      /* !!! REDUCED FROM 32 BITS !!! */
56 + #ifdef PMAP_PRIMARYDIR                                    
57        int32    dir;                 /* Encoded ray direction */
58 + #endif      
59   #ifdef PMAP_PRIMARYPOS      
60        float    pos [3];             /* Hit point */
61   #endif      
# Line 54 | Line 70
70     #define  PMAP_MAXPRIMARY   UINT32_MAX
71  
72     /* Macros for photon's generating subprocess field */
73 < #ifdef PMAP_OOC        
73 > #ifdef PMAP_OOC
74     #define  PMAP_PROCBITS  7
75   #else            
76     #define  PMAP_PROCBITS  5  
# Line 109 | Line 125
125     #define getPhotonFlux(p,f) colr_color(f, (p) -> flux)
126   #endif
127  
112
128    
129     /* Bias compensation history node */
130     typedef struct {                  
# Line 130 | Line 145
145   #endif
146  
147  
148 +   /* Mean size of heapfile write buffer, in number of photons */
149 +   #define PMAP_HEAPBUFSIZE   1e6
150 +  
151 +   /* Mean idle time between heap locking attempts, in usec */
152 +   #define PMAP_HEAPBUFSLEEP  2e6
153 +  
154 +   /* Temporary filename for photon heaps */
155 +   #define PMAP_TMPFNAME      TEMPLATE
156 +   #define PMAP_TMPFNLEN      (TEMPLEN + 1)
157 +
158 +
159     typedef struct PhotonMap {
160        PhotonMapType  type;             /* See pmaptype.h */
161        char           *fileName;        /* Photon map file */
# Line 140 | Line 166
166         * ================================================================ */
167        FILE           *heap;            /* Unsorted photon heap prior to
168                                            construction of store */
169 +      char           heapFname [sizeof(PMAP_TMPFNAME)];      
170        Photon         *heapBuf;         /* Write buffer for above */
171        unsigned long  heapBufLen,       /* Current & max size of heapBuf */
172                       heapBufSize;
173 <      PhotonStorage  store;            /* Photon storage in spacee
173 >      PhotonStorage  store;            /* Photon storage in space
174                                            subdividing data struct */            
175        
176        /* ================================================================
# Line 235 | Line 262
262     #define isContribPmap(p)   ((p) -> type == PMAP_TYPE_CONTRIB)
263     #define isVolumePmap(p)    ((p) -> type == PMAP_TYPE_VOLUME)
264  
238   /* Mean size of heapfile write buffer, in number of photons */
239   #define PMAP_HEAPBUFSIZE   1e6
240  
241   /* Mean idle time between heap locking attempts, in usec */
242   #define PMAP_HEAPBUFSLEEP  2e6
243  
244   /* Shared memory file for parallelised photon distribution */
245 #if 0  
246   #define PMAP_SHMFNAME      "/mkpmap-%d"
247 #else
248   #define PMAP_SHMFNAME      "mkpmapXXXXXX"
249 #endif      
265  
266  
267     void initPhotonMap (PhotonMap *pmap, PhotonMapType t);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines