diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-22 19:21:19 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-23 16:59:06 +0200 |
commit | 6b52ba42865c6d298a8ddf1d735e4c3d3b3dab56 (patch) | |
tree | 6015c4f970f89af47c8ce59a25bcc0fe0d268ca2 /src/gui/rhi/qrhid3d11.cpp | |
parent | 230be3c4d1e53d7024064b926010131c6a83762f (diff) |
rhi: Reuse buffer/texture op entries in res.update batches
More of an enabler for reusing the data in the individual entries since
not clearing the QVLA does not give us much on its own.
Change-Id: Ief9761f75382c3373cc2bc7b866eb59fdd8b3277
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhid3d11.cpp')
-rw-r--r-- | src/gui/rhi/qrhid3d11.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp index f3ddc7aac4..3b14b77ce1 100644 --- a/src/gui/rhi/qrhid3d11.cpp +++ b/src/gui/rhi/qrhid3d11.cpp @@ -1413,7 +1413,8 @@ void QRhiD3D11::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdate QRhiResourceUpdateBatchPrivate *ud = QRhiResourceUpdateBatchPrivate::get(resourceUpdates); QRhiProfilerPrivate *rhiP = profilerPrivateOrNull(); - for (const QRhiResourceUpdateBatchPrivate::BufferOp &u : ud->bufferOps) { + for (int opIdx = 0; opIdx < ud->activeBufferOpCount; ++opIdx) { + const QRhiResourceUpdateBatchPrivate::BufferOp &u(ud->bufferOps[opIdx]); if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate) { QD3D11Buffer *bufD = QRHI_RES(QD3D11Buffer, u.buf); Q_ASSERT(bufD->m_type == QRhiBuffer::Dynamic); @@ -1485,8 +1486,8 @@ void QRhiD3D11::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdate u.result->completed(); } } - - for (const QRhiResourceUpdateBatchPrivate::TextureOp &u : ud->textureOps) { + for (int opIdx = 0; opIdx < ud->activeTextureOpCount; ++opIdx) { + const QRhiResourceUpdateBatchPrivate::TextureOp &u(ud->textureOps[opIdx]); if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Upload) { QD3D11Texture *texD = QRHI_RES(QD3D11Texture, u.dst); for (int layer = 0; layer < QRhi::MAX_LAYERS; ++layer) { |