Skip to content

Commit

Permalink
rhi: remove code duplication in QRhiResourceUpdateBatchPrivate
Browse files Browse the repository at this point in the history
Change-Id: I22ae50d9fbc2f446e819c9d5f740946808bbdfce
Reviewed-by: Laszlo Agocs <[email protected]>
  • Loading branch information
a12e committed Jan 18, 2025
1 parent 39ab9e0 commit 2de013e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/gui/rhi/qrhi_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,7 @@ class QRhiResourceUpdateBatchPrivate
static BufferOp dynamicUpdate(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
{
BufferOp op = {};
op.type = DynamicUpdate;
op.buf = buf;
op.offset = offset;
const int effectiveSize = size ? size : buf->size();
op.data.assign(reinterpret_cast<const char *>(data), effectiveSize);
changeToDynamicUpdate(&op, buf, offset, size, data);
return op;
}

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

Expand Down

0 comments on commit 2de013e

Please sign in to comment.