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

#include <qrhivulkan_p.h>

+ Inheritance diagram for QVkRenderBuffer:
+ Collaboration diagram for QVkRenderBuffer:

Public Member Functions

 QVkRenderBuffer (QRhiImplementation *rhi, Type type, const QSize &pixelSize, int sampleCount, Flags flags, QRhiTexture::Format backingFormatHint)
 
 ~QVkRenderBuffer ()
 
void destroy () override
 Releases (or requests deferred releasing of) the underlying native graphics resources.
 
bool create () override
 Creates the corresponding native graphics resources.
 
QRhiTexture::Format backingFormat () const override
 
- Public Member Functions inherited from QRhiRenderBuffer
QRhiResource::Type resourceType () const override
 
Type type () const
 
void setType (Type t)
 Sets the type to t.
 
QSize pixelSize () const
 
void setPixelSize (const QSize &sz)
 Sets the size (in pixels) to sz.
 
int sampleCount () const
 
void setSampleCount (int s)
 Sets the sample count to s.
 
Flags flags () const
 
void setFlags (Flags f)
 Sets the flags to f.
 
virtual bool createFrom (NativeRenderBuffer src)
 Similar to create() except that no new native renderbuffer objects are created.
 
- 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

VkDeviceMemory memory = VK_NULL_HANDLE
 
VkImage image = VK_NULL_HANDLE
 
VkImageView imageView = VK_NULL_HANDLE
 
VkSampleCountFlagBits samples
 
QVkTexturebackingTexture = nullptr
 
VkFormat vkformat
 
int lastActiveFrameSlot = -1
 
uint generation = 0
 

Friends

class QRhiVulkan
 

Additional Inherited Members

- Public Types inherited from QRhiRenderBuffer
enum  Type { DepthStencil , Color }
 Specifies the type of the renderbuffer. More...
 
enum  Flag { UsedWithSwapChainOnly = 1 << 0 }
 \variable QRhiRenderBuffer::NativeRenderBuffer::object More...
 
- 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 QRhiRenderBuffer
 QRhiRenderBuffer (QRhiImplementation *rhi, Type type_, const QSize &pixelSize_, int sampleCount_, Flags flags_, QRhiTexture::Format backingFormatHint_)
 
- Protected Member Functions inherited from QRhiResource
 QRhiResource (QRhiImplementation *rhi)
 
- Protected Attributes inherited from QRhiRenderBuffer
Type m_type
 
QSize m_pixelSize
 
int m_sampleCount
 
Flags m_flags
 
QRhiTexture::Format m_backingFormatHint
 
- Protected Attributes inherited from QRhiResource
QRhiImplementationm_rhi = nullptr
 
quint64 m_id
 
QByteArray m_objectName
 

Detailed Description

Definition at line 72 of file qrhivulkan_p.h.

Constructor & Destructor Documentation

◆ QVkRenderBuffer()

QVkRenderBuffer::QVkRenderBuffer ( QRhiImplementation * rhi,
Type type,
const QSize & pixelSize,
int sampleCount,
Flags flags,
QRhiTexture::Format backingFormatHint )

Definition at line 6295 of file qrhivulkan.cpp.

◆ ~QVkRenderBuffer()

QVkRenderBuffer::~QVkRenderBuffer ( )

Definition at line 6302 of file qrhivulkan.cpp.

References backingTexture, and destroy().

+ Here is the call graph for this function:

Member Function Documentation

◆ backingFormat()

QRhiTexture::Format QVkRenderBuffer::backingFormat ( ) const
overridevirtual

Implements QRhiRenderBuffer.

Definition at line 6396 of file qrhivulkan.cpp.

References QRhiRenderBuffer::m_backingFormatHint, QRhiRenderBuffer::m_type, QRhiTexture::RGBA8, and QRhiTexture::UnknownFormat.

Referenced by create().

+ Here is the caller graph for this function:

◆ create()

bool QVkRenderBuffer::create ( )
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.

Returns
true when successful, false when a graphics operation failed. Regardless of the return value, calling destroy() is always safe.

Implements QRhiRenderBuffer.

Definition at line 6338 of file qrhivulkan.cpp.

References backingFormat(), backingTexture, QRhiRenderBuffer::Color, QVkTexture::create(), QRhiRenderBuffer::DepthStencil, destroy(), generation, imageView, QSize::isEmpty(), lastActiveFrameSlot, QRhiResource::m_objectName, QRhiRenderBuffer::m_pixelSize, QRhiRenderBuffer::m_sampleCount, QRhiRenderBuffer::m_type, QRHI_RES, QRHI_RES_RHI, QRhiTexture::RenderTarget, QRhiResource::setName(), QRhiTexture::setPixelSize(), QRhiTexture::setSampleCount(), QRhiTexture::UsedAsTransferSource, vkformat, and QVkTexture::vkformat.

+ Here is the call graph for this function:

◆ destroy()

void QVkRenderBuffer::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 6308 of file qrhivulkan.cpp.

References backingTexture, QVkTexture::destroy(), image, imageView, lastActiveFrameSlot, QVkTexture::lastActiveFrameSlot, QRhiVulkan::DeferredReleaseEntry::lastActiveFrameSlot, memory, Q_ASSERT, QRHI_RES_RHI, QRhiVulkan::DeferredReleaseEntry::RenderBuffer, QRhiVulkan::DeferredReleaseEntry::renderBuffer, and QRhiVulkan::DeferredReleaseEntry::type.

Referenced by ~QVkRenderBuffer(), and create().

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

Friends And Related Symbol Documentation

◆ QRhiVulkan

friend class QRhiVulkan
friend

Definition at line 90 of file qrhivulkan_p.h.

Member Data Documentation

◆ backingTexture

QVkTexture* QVkRenderBuffer::backingTexture = nullptr

Definition at line 86 of file qrhivulkan_p.h.

Referenced by ~QVkRenderBuffer(), create(), and destroy().

◆ generation

uint QVkRenderBuffer::generation = 0

Definition at line 89 of file qrhivulkan_p.h.

Referenced by create().

◆ image

VkImage QVkRenderBuffer::image = VK_NULL_HANDLE

Definition at line 83 of file qrhivulkan_p.h.

Referenced by destroy().

◆ imageView

VkImageView QVkRenderBuffer::imageView = VK_NULL_HANDLE

Definition at line 84 of file qrhivulkan_p.h.

Referenced by create(), QVkSwapChain::createOrResize(), and destroy().

◆ lastActiveFrameSlot

int QVkRenderBuffer::lastActiveFrameSlot = -1

Definition at line 88 of file qrhivulkan_p.h.

Referenced by QRhiVulkan::beginFrame(), create(), and destroy().

◆ memory

VkDeviceMemory QVkRenderBuffer::memory = VK_NULL_HANDLE

Definition at line 82 of file qrhivulkan_p.h.

Referenced by destroy().

◆ samples

VkSampleCountFlagBits QVkRenderBuffer::samples

Definition at line 85 of file qrhivulkan_p.h.

◆ vkformat

VkFormat QVkRenderBuffer::vkformat

Definition at line 87 of file qrhivulkan_p.h.

Referenced by create().


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