rhi: Don't fall back to OpenGL backingstore if Metal is not available

We were reusing the QRhiMetalInitParams when falling back to OpenGL,
which caused crashes at runtime.

We remove the fallback altogether, as tests or clients that rely on
a specific RHI backingstore backend should do feature-testing before
requesting the specific backend.

Pick-to: 6.7
Change-Id: Iee38348ae06ea118aafcada33a8956ae07bb2228
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
bb10
Tor Arne Vestbø 2024-05-22 12:20:32 +02:00
parent 529267972b
commit bc1f983781
1 changed files with 2 additions and 2 deletions

View File

@ -114,8 +114,8 @@ bool QBackingStoreRhiSupport::create()
if (QRhi::probe(QRhi::Metal, &params)) {
rhi = QRhi::create(QRhi::Metal, &params, flags);
} else {
qCDebug(lcQpaBackingStore, "Metal does not seem to be supported. Falling back to OpenGL.");
rhi = QRhi::create(QRhi::OpenGLES2, &params, flags);
qCDebug(lcQpaBackingStore, "Metal does not seem to be supported");
return false;
}
}
#endif