From 2de013eb6f4ddf9410e2135d8fcb54cae5bbf682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Brooke?= Date: Tue, 24 Dec 2024 10:08:43 +0100 Subject: [PATCH] rhi: remove code duplication in QRhiResourceUpdateBatchPrivate Change-Id: I22ae50d9fbc2f446e819c9d5f740946808bbdfce Reviewed-by: Laszlo Agocs --- src/gui/rhi/qrhi_p.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/gui/rhi/qrhi_p.h b/src/gui/rhi/qrhi_p.h index a1b159fa745..186e00b8601 100644 --- a/src/gui/rhi/qrhi_p.h +++ b/src/gui/rhi/qrhi_p.h @@ -418,11 +418,7 @@ public: 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(data), effectiveSize); + changeToDynamicUpdate(&op, buf, offset, size, data); return op; } @@ -438,11 +434,7 @@ public: 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(data), effectiveSize); + changeToStaticUpload(&op, buf, offset, size, data); return op; }