![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qrhivulkan_p.h>
Public Member Functions | |
QVkTextureRenderTarget (QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags) | |
~QVkTextureRenderTarget () | |
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 |
QRhiRenderPassDescriptor * | newCompatibleRenderPassDescriptor () override |
bool | create () override |
Creates the corresponding native graphics resources. | |
Public Member Functions inherited from QRhiTextureRenderTarget | |
QRhiResource::Type | resourceType () const override |
QRhiTextureRenderTargetDescription | description () const |
void | setDescription (const QRhiTextureRenderTargetDescription &desc) |
Sets the render target description desc. | |
Flags | flags () const |
void | setFlags (Flags f) |
Sets the flags to f. | |
Public Member Functions inherited from QRhiRenderTarget | |
QRhiRenderPassDescriptor * | renderPassDescriptor () 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 |
QRhi * | rhi () const |
Public Attributes | |
QVkRenderTargetData | d |
VkImageView | rtv [QVkRenderTargetData::MAX_COLOR_ATTACHMENTS] |
VkImageView | dsv = VK_NULL_HANDLE |
VkImageView | resrtv [QVkRenderTargetData::MAX_COLOR_ATTACHMENTS] |
VkImageView | resdsv = VK_NULL_HANDLE |
VkImageView | shadingRateMapView = VK_NULL_HANDLE |
int | lastActiveFrameSlot = -1 |
Friends | |
class | QRhiVulkan |
Definition at line 223 of file qrhivulkan_p.h.
QVkTextureRenderTarget::QVkTextureRenderTarget | ( | QRhiImplementation * | rhi, |
const QRhiTextureRenderTargetDescription & | desc, | ||
Flags | flags ) |
Definition at line 7753 of file qrhivulkan.cpp.
References QVkTextureRenderTarget(), and QVkRenderTargetData::MAX_COLOR_ATTACHMENTS.
Referenced by QVkTextureRenderTarget().
QVkTextureRenderTarget::~QVkTextureRenderTarget | ( | ) |
Definition at line 7764 of file qrhivulkan.cpp.
References destroy().
|
overridevirtual |
Creates the corresponding native graphics resources.
If there are already resources present due to an earlier create() with no corresponding destroy(), then destroy() is called implicitly first.
true
when successful, false
when a graphics operation failed. Regardless of the return value, calling destroy() is always safe. Implements QRhiTextureRenderTarget.
Definition at line 7830 of file qrhivulkan.cpp.
References QVkRenderBuffer::backingTexture, destroy(), and lastActiveFrameSlot.
Referenced by QRhiVulkan::activateTextureRenderTarget(), and pixelSize().
|
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 7769 of file qrhivulkan.cpp.
References QRhiVulkan::DeferredReleaseEntry::lastActiveFrameSlot, lastActiveFrameSlot, QVkRenderTargetData::MAX_COLOR_ATTACHMENTS, QRhiVulkan::DeferredReleaseEntry::TextureRenderTarget, and QRhiVulkan::DeferredReleaseEntry::type.
Referenced by ~QVkTextureRenderTarget(), and create().
|
overridevirtual |
Implements QRhiRenderTarget.
Definition at line 8061 of file qrhivulkan.cpp.
|
overridevirtual |
The returned value is used in two ways: it can be passed to setRenderPassDescriptor() and QRhiGraphicsPipeline::setRenderPassDescriptor(). A render pass descriptor describes the attachments (color, depth/stencil) and the load/store behavior that can be affected by flags(). A QRhiGraphicsPipeline can only be used in combination with a render target that has a \l{QRhiRenderPassDescriptor::isCompatible()}{compatible} QRhiRenderPassDescriptor set.
Two QRhiTextureRenderTarget instances can share the same render pass descriptor as long as they have the same number and type of attachments. The associated QRhiTexture or QRhiRenderBuffer instances are not part of the render pass descriptor so those can differ in the two QRhiTextureRenderTarget instances.
Implements QRhiTextureRenderTarget.
Definition at line 7803 of file qrhivulkan.cpp.
References QVkRenderPassDescriptor::ownsRp, and QVkRenderPassDescriptor::updateSerializedFormat().
|
overridevirtual |
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 8053 of file qrhivulkan.cpp.
References create().
|
overridevirtual |
Implements QRhiRenderTarget.
Definition at line 8066 of file qrhivulkan.cpp.
|
friend |
Definition at line 243 of file qrhivulkan_p.h.
QVkRenderTargetData QVkTextureRenderTarget::d |
Definition at line 236 of file qrhivulkan_p.h.
VkImageView QVkTextureRenderTarget::dsv = VK_NULL_HANDLE |
Definition at line 238 of file qrhivulkan_p.h.
int QVkTextureRenderTarget::lastActiveFrameSlot = -1 |
Definition at line 242 of file qrhivulkan_p.h.
VkImageView QVkTextureRenderTarget::resdsv = VK_NULL_HANDLE |
Definition at line 240 of file qrhivulkan_p.h.
VkImageView QVkTextureRenderTarget::resrtv[QVkRenderTargetData::MAX_COLOR_ATTACHMENTS] |
Definition at line 239 of file qrhivulkan_p.h.
VkImageView QVkTextureRenderTarget::rtv[QVkRenderTargetData::MAX_COLOR_ATTACHMENTS] |
Definition at line 237 of file qrhivulkan_p.h.
VkImageView QVkTextureRenderTarget::shadingRateMapView = VK_NULL_HANDLE |
Definition at line 241 of file qrhivulkan_p.h.