Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QRhiReadbackDescription Class Reference

\inmodule QtGui 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.
 

Detailed Description

\inmodule QtGui

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 776 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 3317 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 785 of file qrhi.h.

Referenced by QRhiD3D11::enqueueResourceUpdates(), QRhiGles2::enqueueResourceUpdates(), QRhiVulkan::enqueueResourceUpdates(), and QRhiNull::resourceUpdate().

+ Here is the caller graph for this function:

◆ 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 788 of file qrhi.h.

Referenced by QRhiD3D11::enqueueResourceUpdates(), QRhiGles2::enqueueResourceUpdates(), QRhiVulkan::enqueueResourceUpdates(), and QRhiNull::resourceUpdate().

+ Here is the caller graph for this function:

◆ setLayer()

void QRhiReadbackDescription::setLayer ( int layer)
inline

Sets the array layer to read back.

Definition at line 786 of file qrhi.h.

◆ setLevel()

void QRhiReadbackDescription::setLevel ( int level)
inline

Sets the mip level to read back.

Definition at line 789 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 783 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 782 of file qrhi.h.

Referenced by QRhiD3D11::enqueueResourceUpdates(), QRhiGles2::enqueueResourceUpdates(), QRhiVulkan::enqueueResourceUpdates(), and QRhiNull::resourceUpdate().

+ Here is the caller graph for this function:

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