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>.
|
#include <qrhivulkan_p.h>
Public Member Functions | |
QVkRenderPassDescriptor (QRhiImplementation *rhi) | |
~QVkRenderPassDescriptor () | |
void | destroy () override |
Releases (or requests deferred releasing of) the underlying native graphics resources. | |
bool | isCompatible (const QRhiRenderPassDescriptor *other) const override |
QRhiRenderPassDescriptor * | newCompatibleRenderPassDescriptor () const override |
QVector< quint32 > | serializedFormat () const override |
const QRhiNativeHandles * | nativeHandles () override |
void | updateSerializedFormat () |
Public Member Functions inherited from QRhiRenderPassDescriptor | |
QRhiResource::Type | resourceType () const override |
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 |
QRhi * | rhi () const |
Public Attributes | |
VkRenderPass | rp = VK_NULL_HANDLE |
bool | ownsRp = false |
QVarLengthArray< VkAttachmentDescription, 8 > | attDescs |
QVarLengthArray< VkAttachmentReference, 8 > | colorRefs |
QVarLengthArray< VkAttachmentReference, 8 > | resolveRefs |
QVarLengthArray< VkSubpassDependency, 2 > | subpassDeps |
bool | hasDepthStencil = false |
bool | hasDepthStencilResolve = false |
uint32_t | multiViewCount = 0 |
VkAttachmentReference | dsRef |
VkAttachmentReference | dsResolveRef |
QVector< quint32 > | serializedFormatData |
QRhiVulkanRenderPassNativeHandles | nativeHandlesStruct |
int | lastActiveFrameSlot = -1 |
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 Member Functions inherited from QRhiRenderPassDescriptor | |
QRhiRenderPassDescriptor (QRhiImplementation *rhi) | |
Protected Member Functions inherited from QRhiResource | |
QRhiResource (QRhiImplementation *rhi) | |
Protected Attributes inherited from QRhiResource | |
QRhiImplementation * | m_rhi = nullptr |
quint64 | m_id |
QByteArray | m_objectName |
Definition at line 148 of file qrhivulkan_p.h.
QVkRenderPassDescriptor::QVkRenderPassDescriptor | ( | QRhiImplementation * | rhi | ) |
Definition at line 6819 of file qrhivulkan.cpp.
References serializedFormatData.
Referenced by newCompatibleRenderPassDescriptor().
QVkRenderPassDescriptor::~QVkRenderPassDescriptor | ( | ) |
Definition at line 6825 of file qrhivulkan.cpp.
References 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.
The QRhiResource destructor also performs the same task, so calling this function is not necessary before deleting a QRhiResource.
Implements QRhiResource.
Definition at line 6830 of file qrhivulkan.cpp.
References lastActiveFrameSlot, QRhiVulkan::DeferredReleaseEntry::lastActiveFrameSlot, ownsRp, QRHI_RES_RHI, QRhiVulkan::DeferredReleaseEntry::RenderPass, QRhiVulkan::DeferredReleaseEntry::renderPass, rp, and QRhiVulkan::DeferredReleaseEntry::type.
Referenced by ~QVkRenderPassDescriptor().
|
overridevirtual |
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).
Implements QRhiRenderPassDescriptor.
Definition at line 6867 of file qrhivulkan.cpp.
References attachmentDescriptionEquals(), attDescs, colorRefs, dsRef, dsResolveRef, hasDepthStencil, hasDepthStencilResolve, i, multiViewCount, o, other(), QRHI_RES, resolveRefs, and QVLABaseBase::size().
|
overridevirtual |
Reimplemented from QRhiRenderPassDescriptor.
Definition at line 7020 of file qrhivulkan.cpp.
References nativeHandlesStruct, and rp.
|
overridevirtual |
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.
Implements QRhiRenderPassDescriptor.
Definition at line 6977 of file qrhivulkan.cpp.
References QVkRenderPassDescriptor(), attDescs, colorRefs, dsRef, dsResolveRef, fillRenderPassCreateInfo(), hasDepthStencil, hasDepthStencilResolve, QRhiResource::m_rhi, multiViewCount, QRHI_RES_RHI, qWarning, resolveRefs, and subpassDeps.
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.
Implements QRhiRenderPassDescriptor.
Definition at line 7015 of file qrhivulkan.cpp.
References serializedFormatData.
void QVkRenderPassDescriptor::updateSerializedFormat | ( | ) |
Definition at line 6927 of file qrhivulkan.cpp.
References attDescs, colorRefs, dsRef, dsResolveRef, hasDepthStencil, hasDepthStencilResolve, i, multiViewCount, resolveRefs, serializedFormatData, and QVLABaseBase::size().
Referenced by QVkTextureRenderTarget::newCompatibleRenderPassDescriptor(), and QVkSwapChain::newCompatibleRenderPassDescriptor().
QVarLengthArray<VkAttachmentDescription, 8> QVkRenderPassDescriptor::attDescs |
Definition at line 162 of file qrhivulkan_p.h.
Referenced by isCompatible(), newCompatibleRenderPassDescriptor(), and updateSerializedFormat().
QVarLengthArray<VkAttachmentReference, 8> QVkRenderPassDescriptor::colorRefs |
Definition at line 163 of file qrhivulkan_p.h.
Referenced by isCompatible(), newCompatibleRenderPassDescriptor(), and updateSerializedFormat().
VkAttachmentReference QVkRenderPassDescriptor::dsRef |
Definition at line 169 of file qrhivulkan_p.h.
Referenced by isCompatible(), newCompatibleRenderPassDescriptor(), and updateSerializedFormat().
VkAttachmentReference QVkRenderPassDescriptor::dsResolveRef |
Definition at line 170 of file qrhivulkan_p.h.
Referenced by isCompatible(), newCompatibleRenderPassDescriptor(), and updateSerializedFormat().
bool QVkRenderPassDescriptor::hasDepthStencil = false |
Definition at line 166 of file qrhivulkan_p.h.
Referenced by isCompatible(), newCompatibleRenderPassDescriptor(), and updateSerializedFormat().
bool QVkRenderPassDescriptor::hasDepthStencilResolve = false |
Definition at line 167 of file qrhivulkan_p.h.
Referenced by isCompatible(), newCompatibleRenderPassDescriptor(), and updateSerializedFormat().
int QVkRenderPassDescriptor::lastActiveFrameSlot = -1 |
Definition at line 173 of file qrhivulkan_p.h.
Referenced by destroy().
uint32_t QVkRenderPassDescriptor::multiViewCount = 0 |
Definition at line 168 of file qrhivulkan_p.h.
Referenced by isCompatible(), newCompatibleRenderPassDescriptor(), and updateSerializedFormat().
QRhiVulkanRenderPassNativeHandles QVkRenderPassDescriptor::nativeHandlesStruct |
Definition at line 172 of file qrhivulkan_p.h.
Referenced by nativeHandles().
bool QVkRenderPassDescriptor::ownsRp = false |
Definition at line 161 of file qrhivulkan_p.h.
Referenced by destroy(), QVkTextureRenderTarget::newCompatibleRenderPassDescriptor(), and QVkSwapChain::newCompatibleRenderPassDescriptor().
QVarLengthArray<VkAttachmentReference, 8> QVkRenderPassDescriptor::resolveRefs |
Definition at line 164 of file qrhivulkan_p.h.
Referenced by isCompatible(), newCompatibleRenderPassDescriptor(), and updateSerializedFormat().
VkRenderPass QVkRenderPassDescriptor::rp = VK_NULL_HANDLE |
Definition at line 160 of file qrhivulkan_p.h.
Referenced by QVkTextureRenderTarget::create(), QVkSwapChain::createOrResize(), destroy(), and nativeHandles().
Definition at line 171 of file qrhivulkan_p.h.
Referenced by QVkRenderPassDescriptor(), serializedFormat(), and updateSerializedFormat().
QVarLengthArray<VkSubpassDependency, 2> QVkRenderPassDescriptor::subpassDeps |
Definition at line 165 of file qrhivulkan_p.h.
Referenced by newCompatibleRenderPassDescriptor().