 	Any,
 };
 
+struct BVHCandidate {
+	int exid;
+	int shapeid;
+};
+
 __device__ bool intersectBVH(
 	cudaTextureObject_t nodes,
-	int* exid,
-	int* shapeid,
+	BVHCandidate* candidates,
+	int& candidateNum,
 	const Context* ctxt,
 	const aten::ray r,
 	float t_min, float t_max,

	aten::Intersection* isect,
	IntersectType type = IntersectType::Closest)
{
	int stackbuf[STACK_SIZE];

	stackbuf[0] = 0;


	real hitt = t_max;
	isect->t = t_max;

	int tmpexid = -1;

	int tmpshapeid = -1;

	int nodeid = -1;
