diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2021-10-08 14:40:58 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-10-12 16:37:41 +0000 |
commit | 353468ed7cd56b2bb527663e326161726380f0cb (patch) | |
tree | 10cff1814f8b1df37baf61dd19aede566ef6c7cf | |
parent | 8fbf61c323c0b6407aab39ba2737c4f52139cfd1 (diff) |
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.
Change-Id: I7389487be67b671830787e30e1468c303b7ac5c2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 6f0d7eb92ecf3e13e4cadac91f74cd8c1e7ce0f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/gui/rhi/qrhi.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index cf663b6945..776109e00e 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -5543,6 +5543,8 @@ void QRhiResourceUpdateBatchPrivate::free() const quint64 mask = 1ULL << quint64(poolIndex); rhi->resUpdPoolMap &= ~mask; poolIndex = -1; + + textureOps.clear(); } void QRhiResourceUpdateBatchPrivate::merge(QRhiResourceUpdateBatchPrivate *other) |