rhi: vk: Reduce memcopies with full dynamic buffer updates
Change-Id: Ifc754a639fcdb45a1b1b8721393de9356504342f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
parent
f84ba3108c
commit
20eb40bce9
@ -2945,8 +2945,11 @@ void QRhiVulkan::enqueueResourceUpdates(QVkCommandBuffer *cbD, QRhiResourceUpdat
|
|||||||
if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate) {
|
if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate) {
|
||||||
QVkBuffer *bufD = QRHI_RES(QVkBuffer, u.buf);
|
QVkBuffer *bufD = QRHI_RES(QVkBuffer, u.buf);
|
||||||
Q_ASSERT(bufD->m_type == QRhiBuffer::Dynamic);
|
Q_ASSERT(bufD->m_type == QRhiBuffer::Dynamic);
|
||||||
for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
|
for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i) {
|
||||||
|
if (u.offset == 0 && u.data.size() == bufD->m_size)
|
||||||
|
bufD->pendingDynamicUpdates[i].clear();
|
||||||
bufD->pendingDynamicUpdates[i].append({ u.offset, u.data });
|
bufD->pendingDynamicUpdates[i].append({ u.offset, u.data });
|
||||||
|
}
|
||||||
} else if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload) {
|
} else if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload) {
|
||||||
QVkBuffer *bufD = QRHI_RES(QVkBuffer, u.buf);
|
QVkBuffer *bufD = QRHI_RES(QVkBuffer, u.buf);
|
||||||
Q_ASSERT(bufD->m_type != QRhiBuffer::Dynamic);
|
Q_ASSERT(bufD->m_type != QRhiBuffer::Dynamic);
|
||||||
|
Loading…
Reference in New Issue
Block a user