File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
RadeonRays/src/kernels/GLSL Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change 27
27
#define INVALID_ADDR 0xffffffffu
28
28
#define INTERNAL_NODE(node) ((node).addr_left != INVALID_ADDR)
29
29
30
+ #define HIT_MARKER 0x1u
31
+ #define MISS_MARKER 0xffffffffu
32
+
30
33
#define GROUP_SIZE 64
31
34
#define STACK_SIZE 32
32
35
#define LDS_STACK_SIZE 8
@@ -45,9 +48,9 @@ struct BvhNode
45
48
46
49
struct Intersection
47
50
{
48
- int shape_id;
49
- int prim_id;
50
- ivec2 padding;
51
+ uint shape_id;
52
+ uint prim_id;
53
+ uvec2 padding;
51
54
vec4 uvwt;
52
55
};
53
56
@@ -280,15 +283,12 @@ void intersect_main()
280
283
281
284
#endif
282
285
283
- #if 0
284
286
// TODO: what, why?!? (gboisse)
285
287
Intersection isect;
286
288
isect.padding.x = 667;
287
- isect.padding.y = r .padding.x;
289
+ isect.padding.y = isect .padding.x;
288
290
isect.uvwt = vec4(0.0f, 0.0f, 0.0f, closest_t);
289
291
290
- #if 0
291
-
292
292
// Check if we have found an intersection
293
293
if (closest_addr != INVALID_ADDR)
294
294
{
@@ -305,20 +305,18 @@ void intersect_main()
305
305
);
306
306
307
307
// Update hit information
308
- hit .prim_id = node.prim_id;
309
- hit .shape_id = node.mesh_id;
308
+ isect .prim_id = node.prim_id;
309
+ isect .shape_id = node.mesh_id;
310
310
}
311
311
else
312
- #endif
313
312
{
314
313
// Miss here
315
- isect.prim_id = -1 ;
316
- isect.shape_id = -1 ;
314
+ isect.prim_id = MISS_MARKER ;
315
+ isect.shape_id = MISS_MARKER ;
317
316
}
318
317
319
318
// Write result to memory
320
319
Hits[index] = isect;
321
- #endif
322
320
}
323
321
324
322
void occluded_main()
You can’t perform that action at this time.
0 commit comments