Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QRhiReadbackDescription Class Reference

\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h More...

#include <qrhi.h>

Collaboration diagram for QRhiReadbackDescription:

Public Member Functions

 QRhiReadbackDescription ()=default
 Constructs an empty texture readback description.
 QRhiReadbackDescription (QRhiTexture *texture)
 Constructs an texture readback description that specifies that level 0 of layer 0 of texture is to be read back.
QRhiTexturetexture () const
void setTexture (QRhiTexture *tex)
 Sets the texture tex as the source of the readback operation.
int layer () const
void setLayer (int layer)
 Sets the array layer to read back.
int level () const
void setLevel (int level)
 Sets the mip level to read back.
QRect rect () const
void setRect (const QRect &rectangle)

Detailed Description

\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h

Since
6.6

Describes a readback (reading back texture contents from possibly GPU-only memory) operation.

The source of the readback operation is either a QRhiTexture or the current backbuffer of the currently targeted QRhiSwapChain. When texture() is not set, the swapchain is used. Otherwise the specified QRhiTexture is treated as the source.

Note
Textures used in readbacks must be created with QRhiTexture::UsedAsTransferSource.
Swapchains used in readbacks must be created with QRhiSwapChain::UsedAsTransferSource.

layer() and level() are only applicable when the source is a QRhiTexture.

Note
Multisample textures cannot be read back. Readbacks are supported for multisample swapchain buffers however.
This is a RHI API with limited compatibility guarantees, see \l QRhi for details.

Definition at line 781 of file qrhi.h.

Constructor & Destructor Documentation

◆ QRhiReadbackDescription() [1/2]

QRhiReadbackDescription::QRhiReadbackDescription ( )
default

Constructs an empty texture readback description.

Note
The source texture is set to null by default, which is still a valid readback: it specifies that the backbuffer of the current swapchain is to be read back. (current meaning the frame's target swapchain at the time of committing the QRhiResourceUpdateBatch with the \l{QRhiResourceUpdateBatch::readBackTexture()}{texture readback} on it)

◆ QRhiReadbackDescription() [2/2]

QRhiReadbackDescription::QRhiReadbackDescription ( QRhiTexture * texture)

Constructs an texture readback description that specifies that level 0 of layer 0 of texture is to be read back.

Note
texture can also be null in which case this constructor is identical to the argumentless variant.

Definition at line 3437 of file qrhi.cpp.

Member Function Documentation

◆ layer()

int QRhiReadbackDescription::layer ( ) const
inline
Returns
the currently set array layer (cubemap face, array index). Defaults to 0.

Applicable only when the source of the readback is a QRhiTexture.

Definition at line 790 of file qrhi.h.

◆ level()

int QRhiReadbackDescription::level ( ) const
inline
Returns
the currently set mip level. Defaults to 0.

Applicable only when the source of the readback is a QRhiTexture.

Definition at line 793 of file qrhi.h.

◆ rect()

QRect QRhiReadbackDescription::rect ( ) const
inline
Since
6.10
Returns
the rectangle to read back. Defaults to an invalid rectangle.

If invalid, the entire texture or swapchain backbuffer is read back.

Definition at line 796 of file qrhi.h.

◆ setLayer()

void QRhiReadbackDescription::setLayer ( int layer)
inline

Sets the array layer to read back.

Definition at line 791 of file qrhi.h.

◆ setLevel()

void QRhiReadbackDescription::setLevel ( int level)
inline

Sets the mip level to read back.

Definition at line 794 of file qrhi.h.

◆ setRect()

void QRhiReadbackDescription::setRect ( const QRect & rectangle)
inline
Since
6.10

Sets the rectangle to read back.

Definition at line 797 of file qrhi.h.

◆ setTexture()

void QRhiReadbackDescription::setTexture ( QRhiTexture * tex)
inline

Sets the texture tex as the source of the readback operation.

Setting \nullptr is valid too, in which case the current swapchain's current backbuffer is used. (but then the readback cannot be issued in a non-swapchain-based frame)

Note
Multisample textures cannot be read back. Readbacks are supported for multisample swapchain buffers however.
Textures used in readbacks must be created with QRhiTexture::UsedAsTransferSource.
Swapchains used in readbacks must be created with QRhiSwapChain::UsedAsTransferSource.

Definition at line 788 of file qrhi.h.

◆ texture()

QRhiTexture * QRhiReadbackDescription::texture ( ) const
inline
Returns
the QRhiTexture that is read back. Can be left set to \nullptr which indicates that the backbuffer of the current swapchain is to be used instead.

Definition at line 787 of file qrhi.h.


The documentation for this class was generated from the following files: