Handle rhi init failures better in rhi backingstore flush

One may very well force a 3D API not functional. In this case there will
be no QRhi. A bunch of warnings will be printed (which is good), but
then flush() should not do anything, and that was not handled before.

Change-Id: I82139070311152c959d39a553842f4462d8e7811
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 108b1014415a491cb0abb58c04a28a5c691085a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Laszlo Agocs 2023-07-19 11:15:06 +02:00 committed by Qt Cherry-pick Bot
parent 908bf2bac4
commit ac6fcaf565

View File

@ -455,6 +455,9 @@ QPlatformBackingStore::FlushResult QBackingStoreDefaultCompositor::flush(QPlatfo
QPlatformTextureList *textures,
bool translucentBackground)
{
if (!rhi)
return QPlatformBackingStore::FlushFailed;
Q_ASSERT(textures); // may be empty if there are no render-to-texture widgets at all, but null it cannot be
if (!m_rhi) {