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
QRhiRenderTarget Class Referenceabstract

\inmodule QtGui More...

#include <qrhi.h>

+ Inheritance diagram for QRhiRenderTarget:
+ Collaboration diagram for QRhiRenderTarget:

Public Member Functions

virtual QSize pixelSize () const =0
 
virtual float devicePixelRatio () const =0
 
virtual int sampleCount () const =0
 
QRhiRenderPassDescriptorrenderPassDescriptor () const
 
void setRenderPassDescriptor (QRhiRenderPassDescriptor *desc)
 Sets the QRhiRenderPassDescriptor desc for use with this render target.
 
- Public Member Functions inherited from QRhiResource
virtual ~QRhiResource ()
 Destructor.
 
virtual Type resourceType () const =0
 
virtual void destroy ()=0
 Releases (or requests deferred releasing of) the underlying native graphics resources.
 
void deleteLater ()
 When called without a frame being recorded, this function is equivalent to deleting the object.
 
QByteArray name () const
 
void setName (const QByteArray &name)
 Sets a name for the object.
 
quint64 globalResourceId () const
 
QRhirhi () const
 

Protected Member Functions

 QRhiRenderTarget (QRhiImplementation *rhi)
 
- Protected Member Functions inherited from QRhiResource
 QRhiResource (QRhiImplementation *rhi)
 

Protected Attributes

QRhiRenderPassDescriptorm_renderPassDesc = nullptr
 
- Protected Attributes inherited from QRhiResource
QRhiImplementationm_rhi = nullptr
 
quint64 m_id
 
QByteArray m_objectName
 

Additional Inherited Members

- Public Types inherited from QRhiResource
enum  Type {
  Buffer , Texture , Sampler , RenderBuffer ,
  RenderPassDescriptor , SwapChainRenderTarget , TextureRenderTarget , ShaderResourceBindings ,
  GraphicsPipeline , SwapChain , ComputePipeline , CommandBuffer
}
 Specifies type of the resource. More...
 

Detailed Description

\inmodule QtGui

Since
6.6

Represents an onscreen (swapchain) or offscreen (texture) render target.

Applications do not create an instance of this class directly. Rather, it is the subclass QRhiTextureRenderTarget that is instantiable by clients of the API via \l{QRhi::newTextureRenderTarget()}{newTextureRenderTarget()}. The other subclass is QRhiSwapChainRenderTarget, which is the type QRhiSwapChain returns when calling \l{QRhiSwapChain::currentFrameRenderTarget()}{currentFrameRenderTarget()}.

Note
This is a RHI API with limited compatibility guarantees, see \l QRhi for details.
See also
QRhiSwapChainRenderTarget, QRhiTextureRenderTarget

Definition at line 1157 of file qrhi.h.

Constructor & Destructor Documentation

◆ QRhiRenderTarget()

QRhiRenderTarget::QRhiRenderTarget ( QRhiImplementation * rhi)
protected

Definition at line 4979 of file qrhi.cpp.

Member Function Documentation

◆ devicePixelRatio()

float QRhiRenderTarget::devicePixelRatio ( ) const
pure virtual
Returns
the device pixel ratio. For QRhiTextureRenderTarget this is always
  1. For targets retrieved from a QRhiSwapChain the value reflects the \l{QWindow::devicePixelRatio()}{device pixel ratio} of the targeted QWindow.

Implemented in QD3D11SwapChainRenderTarget, QD3D11TextureRenderTarget, QGles2SwapChainRenderTarget, QGles2TextureRenderTarget, QMetalSwapChainRenderTarget, QMetalTextureRenderTarget, QNullSwapChainRenderTarget, QNullTextureRenderTarget, QVkSwapChainRenderTarget, and QVkTextureRenderTarget.

Referenced by Item2DPass::renderPrep().

+ Here is the caller graph for this function:

◆ pixelSize()

QSize QRhiRenderTarget::pixelSize ( ) const
pure virtual
Returns
the size in pixels.

Valid only after create() has been called successfully. Until then the result is a default-constructed QSize.

With QRhiTextureRenderTarget the returned size is the size of the associated attachments at the time of create(), in practice the size of the first color attachment, or the depth/stencil buffer if there are no color attachments. If the associated textures or renderbuffers are resized and rebuilt afterwards, then pixelSize() performs an implicit call to create() in order to rebuild the underlying data structures. This implicit check is similar to what QRhiCommandBuffer::beginPass() does, and ensures that the returned size is always up-to-date.

Implemented in QD3D11SwapChainRenderTarget, QD3D11TextureRenderTarget, QGles2SwapChainRenderTarget, QGles2TextureRenderTarget, QMetalSwapChainRenderTarget, QMetalTextureRenderTarget, QNullSwapChainRenderTarget, QNullTextureRenderTarget, QVkSwapChainRenderTarget, and QVkTextureRenderTarget.

Referenced by QSSGRhiContextStats::beginRenderPass(), QQuickRenderTarget::fromRhiRenderTarget(), ExampleRhiItemRenderer::initialize(), ExampleRhiItemRenderer::render(), Item2DPass::renderPrep(), QRhiD3D11::setScissor(), QRhiMetal::setScissor(), QRhiVulkan::setScissor(), QRhiD3D11::setViewport(), QRhiMetal::setViewport(), and QRhiVulkan::setViewport().

+ Here is the caller graph for this function:

◆ renderPassDescriptor()

QRhiRenderPassDescriptor * QRhiRenderTarget::renderPassDescriptor ( ) const
inline
Returns
the associated QRhiRenderPassDescriptor.

Definition at line 1164 of file qrhi.h.

Referenced by ExampleRhiWidget::initialize(), ExampleRhiItemRenderer::initialize(), and QSSGRhiQuadRenderer::recordRenderQuadPass().

+ Here is the caller graph for this function:

◆ sampleCount()

int QRhiRenderTarget::sampleCount ( ) const
pure virtual
Returns
the sample count or 1 if multisample antialiasing is not relevant for this render target.

Implemented in QD3D11SwapChainRenderTarget, QD3D11TextureRenderTarget, QGles2SwapChainRenderTarget, QGles2TextureRenderTarget, QMetalSwapChainRenderTarget, QMetalTextureRenderTarget, QNullSwapChainRenderTarget, QNullTextureRenderTarget, QVkSwapChainRenderTarget, and QVkTextureRenderTarget.

Referenced by QQuickRenderTarget::fromRhiRenderTarget(), and QSGBatchRenderer::Renderer::prepareRenderPass().

+ Here is the caller graph for this function:

◆ setRenderPassDescriptor()

void QRhiRenderTarget::setRenderPassDescriptor ( QRhiRenderPassDescriptor * desc)
inline

Member Data Documentation

◆ m_renderPassDesc


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