 #include "utility.hpp"
 
 namespace {
-	__global__ void correct_disparity_range_kernel(uint16_t* d_disp, int width, int height, int pitch, bool subpixel, int min_disp) {
+	__global__ void correct_disparity_range_kernel(uint16_t* d_disp, int width, int height, int pitch, int min_disp_scaled, int invalid_disp_scaled) {
 		const int x = blockIdx.x * blockDim.x + threadIdx.x;
 		const int y = blockIdx.y * blockDim.y + threadIdx.y;
 

			static constexpr int SIZE = 16;
			const dim3 blocks((width + SIZE - 1) / SIZE, (height + SIZE - 1) / SIZE);
			const dim3 threads(SIZE, SIZE);
			correct_disparity_range_kernel<<<blocks, threads>>>(d_disp, width, height, pitch, subpixel, min_disp);
		}
	}
}

			return;
		}

		uint16_t d = d_disp[y * pitch + x];
		if (d == sgm::INVALID_DISP) {
			d = invalid_disp_scaled;
		} else {
			d += min_disp_scaled;
		}
		d_disp[y * pitch + x] = d;
	}
