rhi: remove code duplication in QRhiResourceUpdateBatchPrivate

Change-Id: I22ae50d9fbc2f446e819c9d5f740946808bbdfce
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
Aurélien Brooke 2024-12-24 10:08:43 +01:00
parent 39ab9e0041
commit 2de013eb6f

View File

@ -418,11 +418,7 @@ public:
static BufferOp dynamicUpdate(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data) static BufferOp dynamicUpdate(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
{ {
BufferOp op = {}; BufferOp op = {};
op.type = DynamicUpdate; changeToDynamicUpdate(&op, buf, offset, size, data);
op.buf = buf;
op.offset = offset;
const int effectiveSize = size ? size : buf->size();
op.data.assign(reinterpret_cast<const char *>(data), effectiveSize);
return op; return op;
} }
@ -438,11 +434,7 @@ public:
static BufferOp staticUpload(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data) static BufferOp staticUpload(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
{ {
BufferOp op = {}; BufferOp op = {};
op.type = StaticUpload; changeToStaticUpload(&op, buf, offset, size, data);
op.buf = buf;
op.offset = offset;
const int effectiveSize = size ? size : buf->size();
op.data.assign(reinterpret_cast<const char *>(data), effectiveSize);
return op; return op;
} }