Copying Depth Texture Pixels

I’m rendering multiple 1-pixel wide camera slices to create omnidirectional stereo images and I need to stitch these all together to put into a final image.

Graphics.CopyTexture(RT_ShadingDepthBuffer, 0, 0, 0, 0, 1, 256, RT_CompositeShadingDepthBuffer, 0, 0, cameraRotationPass, 0);```

Using CopyTexture for the color texture works fine, but fails for the depth texture and I get this.

Graphics.CopyTexture called with depth resource with region not fitting whole subresource
UnityEngine.Graphics:CopyTexture(Texture, Int32, Int32, Int32, Int32, Int32, Int32, Texture, Int32, Int32, Int32, Int32)

Anyone have any ideas how to get around this issue?

Sadly, I never got CopyTexture to work correctly with depth texture regions.

My most horrible solution was writing a screen shader to blit single pixel lines XRes times. It works but it is obviously slowwwww.

I am using Unity 2017.3.1f1, so it may be fixed in newer versions which I still have to check.