diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-22 19:54:30 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-23 16:59:06 +0200 |
commit | be2635b8dd37dfa7cb3f1c41544b2736d13a058d (patch) | |
tree | 09cbe9d0ec2c117aa51948d28f1df5675b05415d /src/gui/rhi/qrhinull.cpp | |
parent | 6b52ba42865c6d298a8ddf1d735e4c3d3b3dab56 (diff) |
rhi: Reuse the data in buffer ops in res.update batches
Because having profilers bombarded with mallocs (due to creating
deep copy QByteArrays) is not nice.
Change-Id: I848f41f3465d6dc2a58a193cc863495aacf13d79
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhinull.cpp')
-rw-r--r-- | src/gui/rhi/qrhinull.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/rhi/qrhinull.cpp b/src/gui/rhi/qrhinull.cpp index 94d24c33a9..087559728d 100644 --- a/src/gui/rhi/qrhinull.cpp +++ b/src/gui/rhi/qrhinull.cpp @@ -465,7 +465,7 @@ void QRhiNull::resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *re || u.type == QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload) { QNullBuffer *bufD = QRHI_RES(QNullBuffer, u.buf); - memcpy(bufD->data.data() + u.offset, u.data.constData(), size_t(u.data.size())); + memcpy(bufD->data.data() + u.offset, u.data.constData(), size_t(u.dataSize)); } else if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::Read) { QRhiBufferReadbackResult *result = u.result; result->data.resize(u.readSize); |