From 6f0d7eb92ecf3e13e4cadac91f74cd8c1e7ce0f9 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 8 Oct 2021 14:40:58 +0200 Subject: [PATCH] RHI: Don't retain texture operations after frame is done Retaining texture upload commands comes at a price, because it means we also retain the backing storage, which could e.g. be fullscreen buffers for applications on Wayland. These would eventually be overwritten, but just clearing the array between frames is also fine because the data is never reused and the array is a QVarLengthArray anyway so it already has a lot of reserved space. Pick-to: 6.2 Change-Id: I7389487be67b671830787e30e1468c303b7ac5c2 Reviewed-by: Laszlo Agocs --- src/gui/rhi/qrhi.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index a281da21d33..e3bb8f288e0 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -5537,6 +5537,8 @@ void QRhiResourceUpdateBatchPrivate::free() const quint64 mask = 1ULL << quint64(poolIndex); rhi->resUpdPoolMap &= ~mask; poolIndex = -1; + + textureOps.clear(); } void QRhiResourceUpdateBatchPrivate::merge(QRhiResourceUpdateBatchPrivate *other)