This patch adds support for merging images rendered with adaptive sampling.
To do this, an int buffer, which stores sample count, is created for each render layer that will be in output image. Samples are loaded from input images using "Debug Sample Count" pass if it exists or from metadata otherwise. "Debug Sample Count" pass merging is handled separately.