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

\inmodule QtGui More...

#include <qrhi.h>

+ Inheritance diagram for QRhiRenderPassDescriptor:
+ Collaboration diagram for QRhiRenderPassDescriptor:

Public Member Functions

QRhiResource::Type resourceType () const override
 
virtual bool isCompatible (const QRhiRenderPassDescriptor *other) const =0
 
virtual const QRhiNativeHandlesnativeHandles ()
 
virtual QRhiRenderPassDescriptornewCompatibleRenderPassDescriptor () const =0
 
virtual QVector< quint32serializedFormat () const =0
 
- Public Member Functions inherited from QRhiResource
virtual ~QRhiResource ()
 Destructor.
 
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

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

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...
 
- Protected Attributes inherited from QRhiResource
QRhiImplementationm_rhi = nullptr
 
quint64 m_id
 
QByteArray m_objectName
 

Detailed Description

\inmodule QtGui

Since
6.6

Render pass resource.

A render pass, if such a concept exists in the underlying graphics API, is a collection of attachments (color, depth, stencil) and describes how those attachments are used.

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

Definition at line 1141 of file qrhi.h.

Constructor & Destructor Documentation

◆ QRhiRenderPassDescriptor()

QRhiRenderPassDescriptor::QRhiRenderPassDescriptor ( QRhiImplementation * rhi)
protected

Definition at line 4858 of file qrhi.cpp.

Member Function Documentation

◆ isCompatible()

bool QRhiRenderPassDescriptor::isCompatible ( const QRhiRenderPassDescriptor * other) const
pure virtual
Returns
true if the other QRhiRenderPassDescriptor is compatible with this one, meaning this and other can be used interchangebly in QRhiGraphicsPipeline::setRenderPassDescriptor().

The concept of the compatibility of renderpass descriptors is similar to the \l{QRhiShaderResourceBindings::isLayoutCompatible}{layout compatibility} of QRhiShaderResourceBindings instances. They allow better reuse of QRhiGraphicsPipeline instances: for example, a QRhiGraphicsPipeline instance cache is expected to use these functions to look for a matching pipeline, instead of just comparing pointers, thus allowing a different QRhiRenderPassDescriptor and QRhiShaderResourceBindings to be used in combination with the pipeline, as long as they are compatible.

The exact details of compatibility depend on the underlying graphics API. Two renderpass descriptors \l{QRhiTextureRenderTarget::newCompatibleRenderPassDescriptor()}{created} from the same QRhiTextureRenderTarget are always compatible.

Similarly to QRhiShaderResourceBindings, compatibility can also be tested without having two existing objects available. Extracting the opaque blob by calling serializedFormat() allows testing for compatibility by comparing the returned vector to another QRhiRenderPassDescriptor's serializedFormat(). This has benefits in certain situations, because it allows testing the compatibility of a QRhiRenderPassDescriptor with a QRhiGraphicsPipeline even when the QRhiRenderPassDescriptor the pipeline was originally built was is no longer available (but the data returned from its serializedFormat() still is).

See also
newCompatibleRenderPassDescriptor(), serializedFormat()

Implemented in QD3D11RenderPassDescriptor, QGles2RenderPassDescriptor, QMetalRenderPassDescriptor, QNullRenderPassDescriptor, and QVkRenderPassDescriptor.

◆ nativeHandles()

const QRhiNativeHandles * QRhiRenderPassDescriptor::nativeHandles ( )
virtual
Returns
a pointer to a backend-specific QRhiNativeHandles subclass, such as QRhiVulkanRenderPassNativeHandles. The returned value is \nullptr when exposing the underlying native resources is not supported by the backend.
See also
QRhiVulkanRenderPassNativeHandles

Reimplemented in QVkRenderPassDescriptor.

Definition at line 4952 of file qrhi.cpp.

Referenced by QSGRhiSupport::rifResource().

+ Here is the caller graph for this function:

◆ newCompatibleRenderPassDescriptor()

QRhiRenderPassDescriptor * QRhiRenderPassDescriptor::newCompatibleRenderPassDescriptor ( ) const
pure virtual
Returns
a new QRhiRenderPassDescriptor that is \l{isCompatible()}{compatible} with this one.

This function allows cloning a QRhiRenderPassDescriptor. The returned object is ready to be used, and the ownership is transferred to the caller. Cloning a QRhiRenderPassDescriptor object can become useful in situations where the object is stored in data structures related to graphics pipelines (in order to allow creating new pipelines which in turn requires a renderpass descriptor object), and the lifetime of the renderpass descriptor created from a render target may be shorter than the pipelines. (for example, because the engine manages and destroys renderpasses together with the textures and render targets it was created from) In such a situation, it can be beneficial to store a cloned version in the data structures, and thus transferring ownership as well.

See also
isCompatible()

Implemented in QD3D11RenderPassDescriptor, QGles2RenderPassDescriptor, QMetalRenderPassDescriptor, QNullRenderPassDescriptor, and QVkRenderPassDescriptor.

◆ resourceType()

QRhiResource::Type QRhiRenderPassDescriptor::resourceType ( ) const
overridevirtual
Returns
the resource type.

Implements QRhiResource.

Definition at line 4866 of file qrhi.cpp.

References QRhiResource::RenderPassDescriptor.

◆ serializedFormat()

QVector< quint32 > QRhiRenderPassDescriptor::serializedFormat ( ) const
pure virtual
Returns
a vector of integers containing an opaque blob describing the data relevant for \l{isCompatible()}{compatibility}.

Given two QRhiRenderPassDescriptor objects rp1 and rp2, if the data returned from this function is identical, then {rp1->isCompatible(rp2)}, and vice versa hold true as well.

Note
The returned data is meant to be used for storing in memory and comparisons during the lifetime of the QRhi the object belongs to. It is not meant for storing on disk, reusing between processes, or using with multiple QRhi instances with potentially different backends.
See also
isCompatible()

Implemented in QD3D11RenderPassDescriptor, QGles2RenderPassDescriptor, QMetalRenderPassDescriptor, QNullRenderPassDescriptor, and QVkRenderPassDescriptor.

Referenced by QSGBatchRenderer::GraphicsPipelineStateKey::create(), and QSSGGraphicsPipelineStateKey::create().

+ Here is the caller graph for this function:

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