 		if (crossed) {
 			ray = intersectCellBoundary(o, d, oldCellIx, cellCount, crossStep, crossOffset);
 			level = min(maxLevel, level + 1);
+#if DEBUG_LINEAR_SEARCH
+			level = 0;
+#endif
 		} else {
 			ray = tempRay;
 			level = level - 1;

}

bool crossedCellBoundary(ivec2 oldCellIx, ivec2 newCellIx) {
	return oldCellIx.x != newCellIx.x || oldCellIx.y != newCellIx.y;
	//return any(notEqual(oldCellIx, newCellIx));
}

// Minimum depth of the current cell in the current HiZ level.

#define HIZ_STOP_LEVEL       0
#define MAX_ITERATIONS       48
#define MAX_THICKNESS        0.001

// Set to 1 to disable HiZ and perform naive linear search.
#define DEBUG_LINEAR_SEARCH  0

// --------------------------------------------------------
// Input
