OpenGL SubmissionContext: reset m_renderTargetFormat for default FBO


We rely on m_renderTargetFormat when doing render capture to know
in whick internal format the currently bound FBO is.

m_renderTargetFormat is reset once per surface change based on the
QSurfaceFormat. However, when using custom RenderTargets, it gets
overwritten in the call to SubmissionContext::activateRenderTarget which
happens for each RenderView. If we switch back to the default FBO in a
RenderView that follows one using a custom RenderTarget, both using the same
surface, we failed to reset the m_renderTargetFormat and it would mistakenly
remain to the value set for the custom RenderTarget.
If a RenderCapture were to happen at that stage, this would lead to crashes
as we would compute the capture buffer assuming a format that doesn't
match that of the current FBO.

Pick-to: 6.5 6.4
Change-Id: I5c722f20857b23b5696617065c8f50406e10aea9
Reviewed-by: Mike Krus <mike.krus@kdab.com>
commit77823b3b678a586f90d1211fa27dddfbf1fe4e71
parentd1e1ccc8f92b12779a1adab853202bc48f8a1cad
authorPaul Lemire <paul.lemire@kdab.com>
committerPaul Lemire <paul.lemire@kdab.com>
commit timeFri, 24 Feb 2023 10:12:20 +0100