From dee6c21fe0aebe9ac36762c29637ea14449b8cea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Brooke?= Date: Tue, 6 May 2025 16:42:14 +0200 Subject: [PATCH] rhi: fix QByteArray static uploads QByteArray is implicitly convertible to void* (!) so the void* staticUpload overloads were accidentally selected, creating a deep copy and defeating the purpose of QByteArray. Fix this by calling the staticUpload functions with the correct number of arguments. Amends 5d857ed3bce64e4a7bdc5247c7dd9ca4495fb10b. Change-Id: I5ab0baa53b764162ca44a3dd1dc6b1d5c68c7925 Reviewed-by: Laszlo Agocs --- src/gui/rhi/qrhi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index 21e8618d38c..42e7753e4cb 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -9630,9 +9630,9 @@ void QRhiResourceUpdateBatch::uploadStaticBuffer(QRhiBuffer *buf, QByteArray dat if (buf->size() > 0 && quint32(data.size()) == buf->size()) { const int idx = d->activeBufferOpCount++; if (idx < d->bufferOps.size()) - QRhiResourceUpdateBatchPrivate::BufferOp::changeToStaticUpload(&d->bufferOps[idx], buf, 0, 0, std::move(data)); + QRhiResourceUpdateBatchPrivate::BufferOp::changeToStaticUpload(&d->bufferOps[idx], buf, 0, std::move(data)); else - d->bufferOps.append(QRhiResourceUpdateBatchPrivate::BufferOp::staticUpload(buf, 0, 0, std::move(data))); + d->bufferOps.append(QRhiResourceUpdateBatchPrivate::BufferOp::staticUpload(buf, 0, std::move(data))); } }