Scene Capture 2D on Mobile

I managed to perform a GPU frame capture on Xcode. The cause of the problem is clear: the color attachment dimensions don’t match the depth attachment dimensions, resulting in an GL_INVALID_FRAMEBUFFER_OPERATION error.

It seems UE4 “recycles” the main depth buffer when updating sceneCaptures but OpenGL specifications require both color and depth/stencil buffers to have the same dimensions, which means the current SceneCapture implementation is violating OpenGL specifications. It might be that previous iOS versions ignored the error and thus it seemed to work.

BTW, there’s also a crash in FOpenGLDynamicRHI::RHISetRenderTargetsAndClear() when you use SceneCapture with development or debug builds in iOS and mobile HDR off.

I’m a bit bummed that this sort of thing isn’t part of automated tests.