qmlglsrc: Fix missing depth & stencil buffer
authorMatthias Fuchs <matthias1.fuchs@zeiss.com>
Mon, 14 Mar 2022 16:20:38 +0000 (17:20 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 6 Apr 2022 09:18:16 +0000 (09:18 +0000)
Qt Quick primitives which have some kind of alpha blending
(transparency, rounded corners) are z-sorted by Qt and rendered in the
correct order. For opaque primitives Qt relies on the OpenGL depth
buffer to correctly determine the visibility of stacked elements.

This change enables the depth buffer to make sure that opaque primitives
are correctly z-stacked.

https://doc.qt.io/qt-6/qtquick-visualcanvas-scenegraph-renderer.html#opaque-primitives

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2114>

subprojects/gst-plugins-good/ext/qt/qtwindow.cc

index a2d931b..70707d8 100644 (file)
@@ -148,7 +148,7 @@ QtGLWindow::beforeRendering()
     GST_DEBUG ("create new framebuffer object %dX%d", width, height);
 
     fbo.reset(new QOpenGLFramebufferObject (width, height,
-          QOpenGLFramebufferObject::NoAttachment, GL_TEXTURE_2D, GL_RGBA));
+          QOpenGLFramebufferObject::CombinedDepthStencil, GL_TEXTURE_2D, GL_RGBA));
 
     source->setRenderTarget(fbo.data());
   } else if (this->priv->useDefaultFbo) {