From bc1f9837815b3a3058be6a51fd032ba10adf472e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 22 May 2024 12:20:32 +0200 Subject: [PATCH] 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 --- src/gui/painting/qbackingstorerhisupport.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qbackingstorerhisupport.cpp b/src/gui/painting/qbackingstorerhisupport.cpp index fe5589dc2d..37c52155eb 100644 --- a/src/gui/painting/qbackingstorerhisupport.cpp +++ b/src/gui/painting/qbackingstorerhisupport.cpp @@ -114,8 +114,8 @@ bool QBackingStoreRhiSupport::create() if (QRhi::probe(QRhi::Metal, ¶ms)) { rhi = QRhi::create(QRhi::Metal, ¶ms, flags); } else { - qCDebug(lcQpaBackingStore, "Metal does not seem to be supported. Falling back to OpenGL."); - rhi = QRhi::create(QRhi::OpenGLES2, ¶ms, flags); + qCDebug(lcQpaBackingStore, "Metal does not seem to be supported"); + return false; } } #endif