aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-07-26 15:56:39 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-07-30 19:00:59 +0200
commit595a90f99117bb9b588065a4492a6cc7ac9e1e34 (patch)
tree83998b88822267c52415a22f3c95dda2b5379ee5
parent25c61c5de86d8ca4debd9a2956702fdb58f42981 (diff)
Have an autorelease pool for each frame on the render thread
Required with Metal. Drawables and various system resources get autoreleased and there is no pool to handle these on the SG render thread by default. This may present a slight perf hit in debug builds due to QMacAutoReleasePool doing smart but - for us - unnecessary stuff every time (so in our case, every frame) but will do for now. This complements the QRhiMetal change for not holding onto the drawable when skipping the present. The pool is essential then to prevent nextDrawable from starving and so blocking. Task-number: QTBUG-76953 Change-Id: Iaf803a0e20504d6b349d3564eda1677868fb29ef Reviewed-by: Andy Nichols <andy.nichols@qt.io>
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 98a493f6ae..93853f57d4 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -902,6 +902,10 @@ void QSGRenderThread::run()
QQuickProfiler::registerAnimationCallback();
while (active) {
+#ifdef Q_OS_DARWIN
+ QMacAutoReleasePool frameReleasePool;
+#endif
+
if (window) {
if (enableRhi) {
if (!rhi) {