 	{
 		dim3 block(BLOCK_SIZE, BLOCK_SIZE);
 		dim3 grid(
-			(width + block.x - 1) / block.x,
-			(height + block.y - 1) / block.y);
+			(m_tileDomain.w + block.x - 1) / block.x,
+			(m_tileDomain.h + block.y - 1) / block.y);
 
 		int curaov = getCurAovs();
 
 		varianceEstimation << <grid, block >> > (
 		//varianceEstimation << <1, 1 >> > (
+			m_tileDomain,
 			outputSurf,
 			m_aovNormalDepth[curaov].ptr(),
 			m_aovTexclrTemporalWeight[curaov].ptr(),

#define IS_IN_BOUND(x, a, b)	((a) <= (x) && (x) < (b))

__global__ void varianceEstimation(
	cudaSurfaceObject_t dst,
	const float4* __restrict__ aovNormalDepth,
	const float4* __restrict__ aovTexclrTemporalWeight,

	int ix = blockIdx.x * blockDim.x + threadIdx.x;
	int iy = blockIdx.y * blockDim.y + threadIdx.y;

	if (ix >= tileDomain.w || iy >= tileDomain.h) {
		return;
	}

	ix += tileDomain.x;
	iy += tileDomain.y;

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

