Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QRhiRenderTarget Class Referenceabstract

\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h 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 ,
  ShadingRateMap
}
 Specifies type of the resource. More...

Detailed Description

\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h

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 1196 of file qrhi.h.

Constructor & Destructor Documentation

◆ QRhiRenderTarget()

QRhiRenderTarget::QRhiRenderTarget ( QRhiImplementation * rhi)
protected

Definition at line 5297 of file qrhi.cpp.

Member Function Documentation

◆ devicePixelRatio()

virtual 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.

◆ pixelSize()

virtual 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.

◆ renderPassDescriptor()

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

Definition at line 1203 of file qrhi.h.

◆ sampleCount()

virtual int QRhiRenderTarget::sampleCount ( ) const
pure virtual

◆ setRenderPassDescriptor()

void QRhiRenderTarget::setRenderPassDescriptor ( QRhiRenderPassDescriptor * desc)
inline

Sets the QRhiRenderPassDescriptor desc for use with this render target.

Definition at line 1204 of file qrhi.h.

Member Data Documentation

◆ m_renderPassDesc

QRhiRenderPassDescriptor* QRhiRenderTarget::m_renderPassDesc = nullptr
protected

Definition at line 1208 of file qrhi.h.


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