![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtGui More...
#include <qrhi.h>
Public Member Functions | |
QRhiTextureUploadDescription ()=default | |
Constructs an empty texture upload description. | |
QRhiTextureUploadDescription (const QRhiTextureUploadEntry &entry) | |
Constructs a texture upload description with a single subresource upload described by entry. | |
QRhiTextureUploadDescription (std::initializer_list< QRhiTextureUploadEntry > list) | |
Constructs a texture upload description with the specified list of entries. | |
void | setEntries (std::initializer_list< QRhiTextureUploadEntry > list) |
Sets the list of entries. | |
template<typename InputIterator > | |
void | setEntries (InputIterator first, InputIterator last) |
Sets the list of entries using the iterators first and last. | |
const QRhiTextureUploadEntry * | cbeginEntries () const |
const QRhiTextureUploadEntry * | cendEntries () const |
const QRhiTextureUploadEntry * | entryAt (qsizetype index) const |
qsizetype | entryCount () const |
\inmodule QtGui
Describes a texture upload operation.
Used with QRhiResourceUpdateBatch::uploadTexture(). That function has two variants: one taking a QImage and one taking a QRhiTextureUploadDescription. The former is a convenience version, internally creating a QRhiTextureUploadDescription with a single image targeting level 0 for layer 0.
An example of the the common, simple case of wanting to upload the contents of a QImage to a QRhiTexture with a matching pixel size:
When cubemaps, pre-generated mip images, compressed textures, or partial uploads are involved, applications will have to use this class instead.
QRhiTextureUploadDescription also enables specifying batched uploads, which are useful for example when generating an atlas or glyph cache texture: multiple, partial uploads for the same subresource (meaning the same layer and level) are supported, and can be, depending on the backend and the underlying graphics API, more efficient when batched into the same QRhiTextureUploadDescription as opposed to issuing individual \l{QRhiResourceUpdateBatch::uploadTexture()}{uploadTexture()} commands for each of them.
For example, specifying the faces of a cubemap could look like the following:
Another example that specifies mip images for a compressed texture:
With partial uploads targeting the same subresource, it is recommended to batch them into a single upload request, whenever possible:
|
default |
Constructs an empty texture upload description.
QRhiTextureUploadDescription::QRhiTextureUploadDescription | ( | const QRhiTextureUploadEntry & | entry | ) |
Constructs a texture upload description with a single subresource upload described by entry.
Definition at line 2989 of file qrhi.cpp.
References QVarLengthArray< T, Prealloc >::append().
QRhiTextureUploadDescription::QRhiTextureUploadDescription | ( | std::initializer_list< QRhiTextureUploadEntry > | list | ) |
Constructs a texture upload description with the specified list of entries.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |