qmlglsrc: Fix missing depth & stencil buffer

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>
This commit is contained in:
Matthias Fuchs 2022-03-14 17:20:38 +01:00 committed by GStreamer Marge Bot
parent 8a55dd9233
commit af71adf315

View 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) {