PySide6.QtGui.QRhiReadbackDescription¶
- class QRhiReadbackDescription¶
Describes a readback (reading back texture contents from possibly GPU-only memory) operation.
Details
The source of the readback operation is either a
QRhiTextureor the current backbuffer of the currently targetedQRhiSwapChain. Whentexture()is not set, the swapchain is used. Otherwise the specifiedQRhiTextureis treated as the source.Note
Textures used in readbacks must be created with
UsedAsTransferSource.Note
Swapchains used in readbacks must be created with
UsedAsTransferSource.layer()andlevel()are only applicable when the source is aQRhiTexture.Note
Multisample textures cannot be read back. Readbacks are supported for multisample swapchain buffers however.
Note
This is a RHI API with limited compatibility guarantees, see
QRhifor details.Added in version 6.6.
Synopsis¶
Methods¶
def
__init__()def
layer()def
level()def
rect()def
setLayer()def
setLevel()def
setRect()def
setTexture()def
texture()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- __init__()¶
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
QRhiResourceUpdateBatchwith thetexture readbackon it)- __init__(texture)
- Parameters:
texture –
QRhiTexture
Constructs an texture readback description that specifies that level 0 of layer 0 of
textureis to be read back.Note
texturecan also be null in which case this constructor is identical to the argumentless variant.- layer()¶
- Return type:
int
Returns the currently set array layer (cubemap face, array index). Defaults to 0.
Applicable only when the source of the readback is a
QRhiTexture.See also
- level()¶
- Return type:
int
Returns the currently set mip level. Defaults to 0.
Applicable only when the source of the readback is a
QRhiTexture.See also
Returns the rectangle to read back. Defaults to an invalid rectangle.
If invalid, the entire texture or swapchain backbuffer is read back.
See also
- setLayer(layer)¶
- Parameters:
layer – int
Sets the array
layerto read back.See also
- setLevel(level)¶
- Parameters:
level – int
Sets the mip
levelto read back.See also
Sets the
rectangleto read back.See also
- setTexture(tex)¶
- Parameters:
tex –
QRhiTexture
Sets the texture
texas the source of the readback operation.Setting
Noneis 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.
Note
Textures used in readbacks must be created with
UsedAsTransferSource.- texture()¶
- Return type:
Returns the
QRhiTexturethat is read back. Can be left set toNonewhich indicates that the backbuffer of the current swapchain is to be used instead.See also