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
QVkSwapChainRenderTarget Struct Reference

#include <qrhivulkan_p.h>

Inheritance diagram for QVkSwapChainRenderTarget:
Collaboration diagram for QVkSwapChainRenderTarget:

Public Member Functions

 QVkSwapChainRenderTarget (QRhiImplementation *rhi, QRhiSwapChain *swapchain)
 ~QVkSwapChainRenderTarget ()
void destroy () override
 Releases (or requests deferred releasing of) the underlying native graphics resources.
QSize pixelSize () const override
float devicePixelRatio () const override
int sampleCount () const override
Public Member Functions inherited from QRhiSwapChainRenderTarget
QRhiResource::Type resourceType () const override
QRhiSwapChainswapChain () const
Public Member Functions inherited from QRhiRenderTarget
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.
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

Public Attributes

QVkRenderTargetData d

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...
Protected Member Functions inherited from QRhiSwapChainRenderTarget
 QRhiSwapChainRenderTarget (QRhiImplementation *rhi, QRhiSwapChain *swapchain_)
Protected Member Functions inherited from QRhiRenderTarget
 QRhiRenderTarget (QRhiImplementation *rhi)
Protected Member Functions inherited from QRhiResource
 QRhiResource (QRhiImplementation *rhi)
Protected Attributes inherited from QRhiSwapChainRenderTarget
QRhiSwapChainm_swapchain
Protected Attributes inherited from QRhiRenderTarget
QRhiRenderPassDescriptorm_renderPassDesc = nullptr
Protected Attributes inherited from QRhiResource
QRhiImplementationm_rhi = nullptr
quint64 m_id
QByteArray m_objectName

Detailed Description

Definition at line 210 of file qrhivulkan_p.h.

Constructor & Destructor Documentation

◆ QVkSwapChainRenderTarget()

QVkSwapChainRenderTarget::QVkSwapChainRenderTarget ( QRhiImplementation * rhi,
QRhiSwapChain * swapchain )

Definition at line 7723 of file qrhivulkan.cpp.

References QVkSwapChainRenderTarget().

Referenced by QVkSwapChainRenderTarget().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~QVkSwapChainRenderTarget()

QVkSwapChainRenderTarget::~QVkSwapChainRenderTarget ( )

Definition at line 7728 of file qrhivulkan.cpp.

References destroy().

Here is the call graph for this function:

Member Function Documentation

◆ destroy()

void QVkSwapChainRenderTarget::destroy ( )
overridevirtual

Releases (or requests deferred releasing of) the underlying native graphics resources.

Safe to call multiple times, subsequent invocations will be a no-op then.

Once destroy() is called, the QRhiResource instance can be reused, by calling create() again. That will then result in creating new native graphics resources underneath.

Note
Resources referenced by commands for the current frame should not be released until the frame is submitted by QRhi::endFrame().

The QRhiResource destructor also performs the same task, so calling this function is not necessary before deleting a QRhiResource.

See also
deleteLater()

Implements QRhiResource.

Definition at line 7733 of file qrhivulkan.cpp.

Referenced by ~QVkSwapChainRenderTarget().

Here is the caller graph for this function:

◆ devicePixelRatio()

float QVkSwapChainRenderTarget::devicePixelRatio ( ) const
overridevirtual
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.

Implements QRhiRenderTarget.

Definition at line 7743 of file qrhivulkan.cpp.

◆ pixelSize()

QSize QVkSwapChainRenderTarget::pixelSize ( ) const
overridevirtual
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.

Implements QRhiRenderTarget.

Definition at line 7738 of file qrhivulkan.cpp.

◆ sampleCount()

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

Implements QRhiRenderTarget.

Definition at line 7748 of file qrhivulkan.cpp.

Member Data Documentation

◆ d

QVkRenderTargetData QVkSwapChainRenderTarget::d

Definition at line 220 of file qrhivulkan_p.h.


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