QRhiReadbackDescription Class

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

头: #include <QRhiReadbackDescription>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Since: Qt 6.6

公共函数

QRhiReadbackDescription ()
QRhiReadbackDescription (QRhiTexture * texture )
int layer () const
int level () const
void setLayer (int layer )
void setLevel (int level )
void setTexture (QRhiTexture * tex )
QRhiTexture * texture () const

详细描述

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

注意: Textures used in readbacks must be created with QRhiTexture::UsedAsTransferSource .

注意: Swapchains used in readbacks must be created with QRhiSwapChain::UsedAsTransferSource .

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

注意: Multisample textures cannot be read back. Readbacks are supported for multisample swapchain buffers however.

注意: This is a RHI API with limited compatibility guarantees, see QRhi 了解细节。

成员函数文档编制

[constexpr noexcept] QRhiReadbackDescription:: QRhiReadbackDescription ()

Constructs an empty texture readback description.

注意: 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 采用 texture readback on it)

QRhiReadbackDescription:: QRhiReadbackDescription ( QRhiTexture * texture )

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

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

int QRhiReadbackDescription:: layer () const

Returns the currently set array layer (cubemap face, array index). Defaults to 0.

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

另请参阅 setLayer ().

int QRhiReadbackDescription:: level () const

Returns the currently set mip level. Defaults to 0.

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

另请参阅 setLevel ().

void QRhiReadbackDescription:: setLayer ( int layer )

Sets the array layer to read back.

另请参阅 layer ().

void QRhiReadbackDescription:: setLevel ( int level )

Sets the mip level to read back.

另请参阅 level ().

void QRhiReadbackDescription:: setTexture ( QRhiTexture * tex )

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

设置 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)

注意: 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 .

另请参阅 texture ().

QRhiTexture *QRhiReadbackDescription:: texture () const

返回 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.

另请参阅 setTexture ().