Skip to content

qt: do not wait for scene graph initialization when probing the graphics api

It is documented that the static function QQuickWindow::graphicsApi() may not yield the ultimate graphics API used by the scene graph and that the way to get the "true, real result" is to wait until the scene graph is initialized.

However, at the same time, it is said that the result would be the "graphics API that would be used by the scene graph if it was initialized at this point in time". This is what is really necessary to know here, as we don't (and should not) override the graphics API in compositors, rather the compositor should tell if it is compatible with the graphics API. If the compositor is not compatible (e.g. using QSGRendererInterface::OpenGL with compositor dcomp), then it should fail at the earliest convenience so that the application can try other compositors.

As of Qt 6.7, Qt Quick does not implement a fallback procedure in case the initialization goes wrong due to the chosen graphics API that it tries a different graphics API. In other words, Qt Quick does not have a cross-graphics API fallback procedure unlike us. And the cross-graphics API fallback that we use gets engaged earlier, so it can be assumed with certainty that the graphics API would not change by the time scene graph is initialized.

Waiting for scene graph initialization has also become less relevant since 0dbfb4b9, where RHI probing and QQuickWindow::setGraphicsApi() became being used in almost all cases. If we set the graphics API explicitly, it means that the same API can be considered by the compositor directly without getting concerned by scene graph initialization and it getting end up with a different graphics API.

Also see !5913 (closed).

Request review @chub.

Merge request reports