QRhiBufferCopyDescription Class
Describes a buffer-to-buffer copy operation. More...
| Header: | #include <rhi/qrhi.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS GuiPrivate)target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate) |
| qmake: | QT += gui-private |
| Since: | Qt 6.13 |
Public Functions
| QRhiBufferCopyDescription() | |
| quint32 | destinationOffset() const |
| void | setDestinationOffset(quint32 offset) |
| void | setSize(quint32 sz) |
| void | setSourceOffset(quint32 offset) |
| quint32 | size() const |
| quint32 | sourceOffset() const |
Detailed Description
A size() of 0 indicates that the entire source buffer is to be copied. A default constructed copy description therefore leads to copying the whole of the source buffer to the beginning of the destination buffer.
Note: The copied region must fit both the source and the destination buffer. When it does not, QRhiResourceUpdateBatch::copyBuffer() prints a warning and drops the operation.
Note: size(), sourceOffset(), and destinationOffset() should all be multiples of 4. This is a requirement of the blit encoder in Metal, and it applies on macOS on Intel-based devices. Other platforms and 3D APIs, including Metal on Apple Silicon and on iOS, have no such restriction, but portable code has to assume the strictest of these. Note that a size() of 0 implies the full size of the source buffer, which is not necessarily a multiple of 4 either.
Note: This is a RHI API with limited compatibility guarantees, see QRhi for details.
See also QRhiResourceUpdateBatch::copyBuffer().
Member Function Documentation
[constexpr noexcept default] QRhiBufferCopyDescription::QRhiBufferCopyDescription()
Constructs an empty buffer copy description.
quint32 QRhiBufferCopyDescription::destinationOffset() const
Returns the offset in bytes into the destination buffer. Defaults to 0.
See also setDestinationOffset().
void QRhiBufferCopyDescription::setDestinationOffset(quint32 offset)
Sets the destination offset in bytes.
See also destinationOffset().
void QRhiBufferCopyDescription::setSize(quint32 sz)
Sets the number of bytes to copy to sz.
See also size().
void QRhiBufferCopyDescription::setSourceOffset(quint32 offset)
Sets the source offset in bytes.
See also sourceOffset().
quint32 QRhiBufferCopyDescription::size() const
Returns the number of bytes to copy.
Note: A size() of 0 indicates that the entire source buffer is to be copied.
See also setSize().
quint32 QRhiBufferCopyDescription::sourceOffset() const
Returns the offset in bytes into the source buffer. Defaults to 0.
See also setSourceOffset().
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.