The first 3-4 frames of a Qt 3D scene are drawn empty. This is because we call swapBuffer even when nothing has been drawn. There are a few things that cause this that need to be fixed:
- Some jobs in the first frame are not completed because the context is not yet initialized when the jobs run (see QTBUG-65878)
- Renderer::doRender() keeps going even if jobs failed
- Renderer::doRender() has no way to initialize the context without calling GraphicsContext::beginDrawing()
- Renderer::doRender() calls GraphicsContext::beginDrawing() and GraphicsContext::endDrawing() even if there are no valid commands in the render views
While this has little consequence for continuous rendering, it can cause problems when renderPolicy is set to RenderSettings.OnDemand. In this case we may end up rendering a couple of empty frames and then stop.