Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
59e5a546 by Fatih Uzunoglu at 2025-12-18T15:55:44+00:00
qt: disable pip player and backdrop blur if there is no depth buffer with rhi

"View blocking", or not letting a certain part of the scene being
painted depends on a graphics optimization that is only possible
with depth buffer.

We could theoretically improve `ViewBlockingRectangle` by using a
custom render node and clear what was already rendered beneath when
there is no depth buffer, similar to how it is already done in
software mode, but that would be bad for maintenance because of
needing to support multiple graphics backends. This approach would
be more robust, but so far relying on depth buffer has not really
been problematic.

- - - - -


1 changed file:

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


Changes:

=====================================
modules/gui/qt/maininterface/compositor.cpp
=====================================
@@ -286,14 +286,28 @@ bool CompositorVideo::commonGUICreateImpl(QWindow* 
window, CompositorVideo::Flag
 
     m_videoSurfaceProvider = 
std::make_unique<VideoSurfaceProvider>(canDoThreadedSurfaceUpdates());
     m_mainCtx->setVideoSurfaceProvider(m_videoSurfaceProvider.get());
-    const bool backendIsOpenVg = QQuickWindow::sceneGraphBackend() == 
QLatin1String("openvg");
-    if (!backendIsOpenVg && (flags & CompositorVideo::CAN_SHOW_PIP) && 
var_InheritBool(m_intf, "qt-pip-mode"))
+
+    const QQuickWindow *const quickWindow = this->quickWindow();
+    assert(quickWindow);
+    assert(quickWindow->handle()); // Make sure `::create()` was called before
+    assert(quickWindow->rendererInterface());
+    // `ViewBlockingRectangle` only supports RHI with depth buffer (which is 
the default) or software mode:
+    const bool hasDepthBufferOrSoftwareMode = 
(quickWindow->format().depthBufferSize() > 0) ||
+                                              
(quickWindow->rendererInterface()->graphicsApi() == 
QSGRendererInterface::Software);
+    if (!hasDepthBufferOrSoftwareMode)
+        qWarning() << this << ": interface window has no depth buffer, pip 
player and backdrop blur will not be functional!";
+
+    if (hasDepthBufferOrSoftwareMode && (flags & 
CompositorVideo::CAN_SHOW_PIP) && var_InheritBool(m_intf, "qt-pip-mode"))
     {
         m_mainCtx->setCanShowVideoPIP(true);
     }
     m_mainCtx->setWindowSuportExtendedFrame(flags & 
CompositorVideo::HAS_EXTENDED_FRAME);
-    if (!backendIsOpenVg && (flags & CompositorVideo::HAS_ACRYLIC))
+    if (hasDepthBufferOrSoftwareMode && (flags & CompositorVideo::HAS_ACRYLIC))
     {
+        // FIXME: Normally window backdrop blur effect does not require depth 
buffer, provided that there is nothing between
+        //        the window and the scene item that paints. Unfortunately 
this is not the case in multiple cases, due to
+        //        various reasons. Because of that, we disable blur altogether 
when there is no depth buffer.
+
 #ifndef _WIN32
         assert(qGuiApp);
         if (qGuiApp->platformName().startsWith(QLatin1String("wayland")) && 
Q_LIKELY(!window->isActive()))



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

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


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to