summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi/qrhi.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-10-08 14:40:58 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-10-12 11:33:19 +0000
commit6f0d7eb92ecf3e13e4cadac91f74cd8c1e7ce0f9 (patch)
tree7bda6e590b715d9a3fa6c4b645a9c7de10196652 /src/gui/rhi/qrhi.cpp
parent95fd21a26a2b6316aa5b178d5a1fce24feba13a6 (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. Pick-to: 6.2 Change-Id: I7389487be67b671830787e30e1468c303b7ac5c2 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhi.cpp')
-rw-r--r--src/gui/rhi/qrhi.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp
index a281da21d3..e3bb8f288e 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)