[vlc-commits] [Git][videolan/vlc][master] qt: dcomp: fix sanity check passes in non-rhi mode

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Mar 16 17:53:19 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
f3c492b1 by Fatih Uzunoglu at 2026-03-16T17:21:35+00:00
qt: dcomp: fix sanity check passes in non-rhi mode

This fixes assertion failure when software mode is
used as fallback, particularly when D3D and OpenGL
probing both fail.

CompositorDirectComposition is only functional with
rhi d3d11 and d3d12, anything else is not supported.

D3D Warp is expected to be supported, but subject to
more testing.

- - - - -


1 changed file:

- modules/gui/qt/maininterface/compositor_dcomp.cpp


Changes:

=====================================
modules/gui/qt/maininterface/compositor_dcomp.cpp
=====================================
@@ -138,7 +138,7 @@ bool CompositorDirectComposition::init()
         return false;
     }
 
-    const QString& sceneGraphBackend = qEnvironmentVariable("QT_QUICK_BACKEND");
+    QString sceneGraphBackend = qEnvironmentVariable("QT_QUICK_BACKEND");
     if (!sceneGraphBackend.isEmpty() /* if empty, RHI is used */ &&
         sceneGraphBackend != QLatin1String("rhi"))
     {
@@ -153,6 +153,16 @@ bool CompositorDirectComposition::init()
         // the environment variable.
         return false;
     }
+    else
+    {
+        // If `QQuickWindow::setGraphicsApi()` is used with a non-RHI
+        // mode such as `software`, Qt at the moment adjusts the scene
+        // graph backend but not the `QQuickWindow::graphicsApi()`.
+        // Until Qt does that, we need to check it here additionally:
+        sceneGraphBackend = QQuickWindow::sceneGraphBackend();
+        if (!sceneGraphBackend.isEmpty() && sceneGraphBackend != QLatin1String("rhi"))
+            return false;
+    }
 
     const auto graphicsApi = QQuickWindow::graphicsApi();
     if (graphicsApi != QSGRendererInterface::Direct3D11 &&



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f3c492b1cb217fb6cac5c21829ff12a5ad748aef

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f3c492b1cb217fb6cac5c21829ff12a5ad748aef
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list