 		else {
 			nodeid = (int)node1.w;
 		}
+#endif
 	}
-#endif
 
 	return (isect->objid >= 0);
 }

			node = ctxt->nodes[0];
			transformedRay = r;
		}
	}
#else
	while (nodeid >= 0) {
		node0 = tex1Dfetch<float4>(node, aten::GPUBvhNodeSize * nodeid + 0);	// xyz : boxmin, z: hit
		node1 = tex1Dfetch<float4>(node, aten::GPUBvhNodeSize * nodeid + 1);	// xyz : boxmin, z: hit
		attrib = tex1Dfetch<float4>(node, aten::GPUBvhNodeSize * nodeid + 2);	// x : shapeid, y : primid, z : exid, w : meshid

		boxmin = make_float4(node0.x, node0.y, node0.z, 1.0f);
		boxmax = make_float4(node1.x, node1.y, node1.z, 1.0f);

		bool isHit = false;

		if (attrib.x >= 0) {
			// Leaf.
			const auto* s = &ctxt->shapes[(int)attrib.x];

			if (attrib.z >= 0) {	// exid
									//if (aten::aabb::hit(r, boxmin, boxmax, t_min, t_max, &t)) {
				if (hitAABB(r.org, r.dir, boxmin, boxmax, t_min, t_max, &t)) {
					aten::ray transformedRay;


	real t = AT_MATH_INF;

	cudaTextureObject_t node = ctxt->nodes[0];
	aten::ray transformedRay = r;

	int toplayerHit = -1;
