 	const auto idx = getIdx(ix, iy, width);
 
 	const auto& path = paths[idx];
+
+	int sample = path.samples;
 
 	float4 data;
 #if 0

__global__ void gather(
	cudaSurfaceObject_t outSurface,
	Path* paths,
	int width, int height,
	int sample)
{
	const auto ix = blockIdx.x * blockDim.x + threadIdx.x;
	const auto iy = blockIdx.y * blockDim.y + threadIdx.y;

	const auto idx = getIdx(ix, iy, width);

	auto& path = paths[idx];
	path.isHit = false;

	if (path.isKill) {
		path.isTerminate = true;
		return;
	}

	path.sampler.init((iy * height * 4 + ix * 4) * maxSamples + sample + 1 + seed);

	float s = (ix + path.sampler.nextSample()) / (float)(camera->width);
