![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtGui More...
#include <qrhi.h>
Public Member Functions | |
QRhiTextureRenderTargetDescription ()=default | |
Constructs an empty texture render target description. | |
QRhiTextureRenderTargetDescription (const QRhiColorAttachment &colorAttachment) | |
Constructs a texture render target description with one attachment described by colorAttachment. | |
QRhiTextureRenderTargetDescription (const QRhiColorAttachment &colorAttachment, QRhiRenderBuffer *depthStencilBuffer) | |
Constructs a texture render target description with two attachments, a color attachment described by colorAttachment, and a depth/stencil attachment with depthStencilBuffer. | |
QRhiTextureRenderTargetDescription (const QRhiColorAttachment &colorAttachment, QRhiTexture *depthTexture) | |
Constructs a texture render target description with two attachments, a color attachment described by colorAttachment, and a depth attachment with depthTexture. | |
void | setColorAttachments (std::initializer_list< QRhiColorAttachment > list) |
Sets the list of color attachments. | |
template<typename InputIterator > | |
void | setColorAttachments (InputIterator first, InputIterator last) |
Sets the list of color attachments via the iterators first and last. | |
const QRhiColorAttachment * | cbeginColorAttachments () const |
const QRhiColorAttachment * | cendColorAttachments () const |
const QRhiColorAttachment * | colorAttachmentAt (qsizetype index) const |
qsizetype | colorAttachmentCount () const |
QRhiRenderBuffer * | depthStencilBuffer () const |
void | setDepthStencilBuffer (QRhiRenderBuffer *renderBuffer) |
Sets the renderBuffer for depth-stencil. | |
QRhiTexture * | depthTexture () const |
void | setDepthTexture (QRhiTexture *texture) |
Sets the texture for depth-stencil. | |
\inmodule QtGui
Describes the color and depth or depth/stencil attachments of a render target.
A texture render target has zero or more textures as color attachments, zero or one renderbuffer as combined depth/stencil buffer or zero or one texture as depth buffer.
Let's look at some example usages in combination with QRhiTextureRenderTarget.
Due to the constructors, the targeting a texture (and no depth/stencil buffer) is simple:
The following creates a texture render target that is set up to target mip level #2 of a texture:
Another example, this time to render into a depth texture:
A very common case, having a texture as the color attachment and a renderbuffer as depth/stencil to enable depth testing:
Finally, to enable multisample rendering in a portable manner (so also supporting OpenGL ES 3.0), using a QRhiRenderBuffer as the (multisample) color buffer and then resolving into a regular (non-multisample) 2D texture. To enable depth testing, a depth-stencil buffer, which also must use the same sample count, is used as well:
|
default |
Constructs an empty texture render target description.
QRhiTextureRenderTargetDescription::QRhiTextureRenderTargetDescription | ( | const QRhiColorAttachment & | colorAttachment | ) |
Constructs a texture render target description with one attachment described by colorAttachment.
Definition at line 2502 of file qrhi.cpp.
References QVarLengthArray< T, Prealloc >::append().
QRhiTextureRenderTargetDescription::QRhiTextureRenderTargetDescription | ( | const QRhiColorAttachment & | colorAttachment, |
QRhiRenderBuffer * | depthStencilBuffer | ||
) |
Constructs a texture render target description with two attachments, a color attachment described by colorAttachment, and a depth/stencil attachment with depthStencilBuffer.
Definition at line 2512 of file qrhi.cpp.
References QVarLengthArray< T, Prealloc >::append().
QRhiTextureRenderTargetDescription::QRhiTextureRenderTargetDescription | ( | const QRhiColorAttachment & | colorAttachment, |
QRhiTexture * | depthTexture | ||
) |
Constructs a texture render target description with two attachments, a color attachment described by colorAttachment, and a depth attachment with depthTexture.
Definition at line 2527 of file qrhi.cpp.
References QVarLengthArray< T, Prealloc >::append().
|
inline |
Definition at line 626 of file qrhi.h.
Referenced by QRhiVulkan::activateTextureRenderTarget(), QRhiMetal::beginPass(), QD3D11TextureRenderTarget::create(), QGles2TextureRenderTarget::create(), QMetalTextureRenderTarget::create(), QNullTextureRenderTarget::create(), QVkTextureRenderTarget::create(), QRhiD3D11::endPass(), QRhiGles2::endPass(), QRhiGles2::enqueueBindFramebuffer(), QVkTextureRenderTarget::newCompatibleRenderPassDescriptor(), and renderToKTXFileInternal().
|
inline |
Definition at line 627 of file qrhi.h.
Referenced by QRhiVulkan::activateTextureRenderTarget(), QRhiMetal::beginPass(), QD3D11TextureRenderTarget::create(), QGles2TextureRenderTarget::create(), QMetalTextureRenderTarget::create(), QNullTextureRenderTarget::create(), QVkTextureRenderTarget::create(), QRhiD3D11::endPass(), QRhiGles2::endPass(), QRhiGles2::enqueueBindFramebuffer(), and QVkTextureRenderTarget::newCompatibleRenderPassDescriptor().
|
inline |
Definition at line 628 of file qrhi.h.
Referenced by QMetalTextureRenderTarget::newCompatibleRenderPassDescriptor().
|
inline |
Definition at line 629 of file qrhi.h.
Referenced by QD3D11TextureRenderTarget::create(), QGles2TextureRenderTarget::create(), QMetalTextureRenderTarget::create(), QVkTextureRenderTarget::create(), and QMetalTextureRenderTarget::newCompatibleRenderPassDescriptor().
|
inline |
Definition at line 631 of file qrhi.h.
Referenced by QRhiVulkan::activateTextureRenderTarget(), QRhiMetal::beginPass(), QD3D11TextureRenderTarget::create(), QGles2TextureRenderTarget::create(), QMetalTextureRenderTarget::create(), QNullTextureRenderTarget::create(), QVkTextureRenderTarget::create(), QMetalTextureRenderTarget::newCompatibleRenderPassDescriptor(), and QVkTextureRenderTarget::newCompatibleRenderPassDescriptor().
|
inline |
Definition at line 634 of file qrhi.h.
Referenced by QRhiVulkan::activateTextureRenderTarget(), QRhiMetal::beginPass(), QD3D11TextureRenderTarget::create(), QGles2TextureRenderTarget::create(), QMetalTextureRenderTarget::create(), QNullTextureRenderTarget::create(), QVkTextureRenderTarget::create(), QRhiGles2::enqueueBindFramebuffer(), QMetalTextureRenderTarget::newCompatibleRenderPassDescriptor(), and QVkTextureRenderTarget::newCompatibleRenderPassDescriptor().
|
inline |
|
inline |
Sets the list of color attachments.
Definition at line 619 of file qrhi.h.
References list.
Referenced by QSSGRenderReflectionMap::addReflectionMapEntry(), QSSGRenderShadowMap::addShadowMapEntry(), renderToKTXFileInternal(), and QQuick3DSceneRenderer::synchronize().
|
inline |
Sets the renderBuffer for depth-stencil.
Not mandatory, e.g. when no depth test/write or stencil-related features are used within any graphics pipelines in any of the render passes for this render target, it can be left set to \nullptr.
Using a QRhiRenderBuffer over a 2D QRhiTexture as the depth or depth/stencil buffer is very common, and is the recommended approach for applications. Using a QRhiTexture, and so setDepthTexture() becomes relevant if the depth data is meant to be accessed (e.g. sampled in a shader) afterwards, or when \l{QRhiColorAttachment::setMultiViewCount()}{multiview rendering} is involved (because then the depth texture must be a texture array).
Definition at line 632 of file qrhi.h.
Referenced by QSSGRenderReflectionMap::addReflectionMapEntry(), QSSGRenderShadowMap::addShadowMapEntry(), createRhiRenderTarget(), QSGRhiSupport::grabOffscreen(), and QQuick3DSceneRenderer::synchronize().
|
inline |
Sets the texture for depth-stencil.
This is an alternative to setDepthStencilBuffer(), where instead of a QRhiRenderBuffer a QRhiTexture with a suitable type (e.g., QRhiTexture::D32F) is provided.
texture can either be a 2D texture or a 2D texture array (when texture arrays are supported). Specifying a texture array is relevant in particular with \l{QRhiColorAttachment::setMultiViewCount()}{multiview rendering}.
Definition at line 635 of file qrhi.h.
Referenced by RenderHelpers::rhiPrepareDepthTexture().