This commit is contained in:
Evghenii
2013-11-18 13:15:05 +01:00
parent 4f9b8ebc73
commit 64762c5acd

View File

@@ -2,6 +2,7 @@
#define programIndex (threadIdx.x & 31) #define programIndex (threadIdx.x & 31)
#define taskIndex (blockIdx.x*4 + (threadIdx.x >> 5)) #define taskIndex (blockIdx.x*4 + (threadIdx.x >> 5))
#define taskCount (gridDim.x*4) #define taskCount (gridDim.x*4)
#define warpIdx (threadIdx.x >> 5)
#define float3 Float3 #define float3 Float3
struct Float3 struct Float3
@@ -235,7 +236,12 @@ static inline bool BVHIntersect(const LinearBVHNode nodes[],
bool hit = false; bool hit = false;
// Follow ray through BVH nodes to find primitive intersections // Follow ray through BVH nodes to find primitive intersections
int todoOffset = 0, nodeNum = 0; int todoOffset = 0, nodeNum = 0;
#if 0
__shared__ int todoX[64*4];
volatile int * todo = &todoX[warpIdx * 64];
#else
int todo[64]; int todo[64];
#endif
while (true) { while (true) {
// Check ray against BVH node // Check ray against BVH node