diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-05-28 19:23:49 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-06-03 17:05:44 +0200 |
commit | 64089b900fe245cc64c10ff47033dda60d4a5f86 (patch) | |
tree | 07f3f38f6ff40738969f8886b6ce707e39be8bf2 /src/gui/rhi/qrhi.cpp | |
parent | 4652da536a5db3608e6026b27dfe808227b721f2 (diff) |
rhi: Enable reading back slices of 3D textures
Change-Id: I0c687677b7e86b7284130c775718b29aca2cca40
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhi.cpp')
-rw-r--r-- | src/gui/rhi/qrhi.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index 58962b8e35..78c615451e 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -2426,8 +2426,7 @@ bool QRhiRenderBuffer::createFrom(NativeRenderBuffer src) \value ThreeDimensional The texture is a 3D texture. Such textures should be created with the QRhi::newTexture() overload taking a depth in addition to width and height. A 3D texture can have mipmaps but cannot be - multisample. Reading back the contents of a 3D texture is not currently - supported. When rendering into a 3D texture, the layer specified in the + multisample. When rendering into a 3D texture, the layer specified in the render target's color attachment refers to a slice in range [0..depth-1]. The underlying graphics API may not support 3D textures at run time. Support is indicated by the QRhi::ThreeDimensionalTextures feature. @@ -5322,8 +5321,6 @@ void QRhiResourceUpdateBatch::copyTexture(QRhiTexture *dst, QRhiTexture *src, co \note Multisample textures cannot be read back. - \note 3D textures cannot be read back. - \note The readback returns raw byte data, in order to allow the applications to interpret it in any way they see fit. Be aware of the blending settings of rendering code: if the blending is set up to rely on premultiplied alpha, @@ -5342,6 +5339,10 @@ void QRhiResourceUpdateBatch::copyTexture(QRhiTexture *dst, QRhiTexture *src, co N is the \l{QRhi::resourceLimit()}{resource limit value} returned for QRhi::MaxAsyncReadbackFrames. + A single readback operation copies one mip level of one layer (cubemap face + or 3D slice) at a time. The level and layer are specified by the respective + fields in \a rb. + \sa readBackBuffer(), QRhi::resourceLimit() */ void QRhiResourceUpdateBatch::readBackTexture(const QRhiReadbackDescription &rb, QRhiReadbackResult *result) |