 			(width + block.x - 1) / block.x,
 			(height + block.y - 1) / block.y);
 
-		if (m_mode == Mode::AOVar) {
-			genPath<true> << <grid, block >> > (
-				m_paths.ptr(),
-				m_rays.ptr(),
-				width, height,
-				sample, maxSamples,
-				m_frame,
-				m_cam.ptr(),
-				m_sobolMatrices.ptr(),
-				m_random.ptr());
-		}
-		else {
-			genPath<false> << <grid, block >> > (
-				m_paths.ptr(),
-				m_rays.ptr(),
-				width, height,
-				sample, maxSamples,
-				m_frame,
-				m_cam.ptr(),
-				m_sobolMatrices.ptr(),
-				m_random.ptr());
-		}
+		bool isFillAOV = m_mode == Mode::AOVar;
+
+		genPath << <grid, block >> > (
+			isFillAOV,
+			m_paths.ptr(),
+			m_rays.ptr(),
+			width, height,
+			sample, maxSamples,
+			m_frame,
+			m_cam.ptr(),
+			m_sobolMatrices.ptr(),
+			m_random.ptr());
 
 		checkCudaKernel(genPath);
 	}

#endif
}

template <bool isFirstBounce>
__global__ void shadeMiss(
	float4* aovNormalDepth,
	float4* aovTexclrTemporalWeight,
	float4* aovMomentMeshid,

				width, height);
		}
		else {
			shadeMiss << <grid, block >> > (
				bounce,
				m_aovNormalDepth[curaov].ptr(),
				m_aovTexclrTemporalWeight[curaov].ptr(),
				m_aovMomentMeshid[curaov].ptr(),
				m_paths.ptr(),
				width, height);
		}

		checkCudaKernel(shadeMiss);
