diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-29 17:38:26 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-30 10:39:59 +0200 |
commit | 2f879062a5ce9e78c1e257924bcdc5ac95cba465 (patch) | |
tree | 34222dd886c8608d4ea7190763a67827f598e321 /src/gui/rhi/qrhid3d11.cpp | |
parent | 0836db2330c0542d91fe61935e97d3369db93156 (diff) |
rhi: Manage buffer data without QBA
Use a simple and straightforward container that only does what
we need here.
Change-Id: I1a81b53a58bc91d533e3d7df5471a1362046825d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhid3d11.cpp')
-rw-r--r-- | src/gui/rhi/qrhid3d11.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp index 1c7f3cd17a..2fe138dd55 100644 --- a/src/gui/rhi/qrhid3d11.cpp +++ b/src/gui/rhi/qrhid3d11.cpp @@ -1418,17 +1418,17 @@ void QRhiD3D11::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdate if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate) { QD3D11Buffer *bufD = QRHI_RES(QD3D11Buffer, u.buf); Q_ASSERT(bufD->m_type == QRhiBuffer::Dynamic); - memcpy(bufD->dynBuf + u.offset, u.data.constData(), size_t(u.dataSize)); + memcpy(bufD->dynBuf + u.offset, u.data.constData(), size_t(u.data.size())); bufD->hasPendingDynamicUpdates = true; } else if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload) { QD3D11Buffer *bufD = QRHI_RES(QD3D11Buffer, u.buf); Q_ASSERT(bufD->m_type != QRhiBuffer::Dynamic); - Q_ASSERT(u.offset + u.dataSize <= bufD->m_size); + Q_ASSERT(u.offset + u.data.size() <= bufD->m_size); QD3D11CommandBuffer::Command cmd; cmd.cmd = QD3D11CommandBuffer::Command::UpdateSubRes; cmd.args.updateSubRes.dst = bufD->buffer; cmd.args.updateSubRes.dstSubRes = 0; - cmd.args.updateSubRes.src = cbD->retainData(u.data); + cmd.args.updateSubRes.src = cbD->retainBufferData(u.data); cmd.args.updateSubRes.srcRowPitch = 0; // Specify the region (even when offset is 0 and all data is provided) // since the ID3D11Buffer's size is rounded up to be a multiple of 256 @@ -1437,7 +1437,7 @@ void QRhiD3D11::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdate box.left = UINT(u.offset); box.top = box.front = 0; box.back = box.bottom = 1; - box.right = UINT(u.offset + u.dataSize); // no -1: right, bottom, back are exclusive, see D3D11_BOX doc + box.right = UINT(u.offset + u.data.size()); // no -1: right, bottom, back are exclusive, see D3D11_BOX doc cmd.args.updateSubRes.hasDstBox = true; cmd.args.updateSubRes.dstBox = box; cbD->commands.append(cmd); |