Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QVkShaderResourceBindings Struct Reference

#include <qrhivulkan_p.h>

+ Inheritance diagram for QVkShaderResourceBindings:
+ Collaboration diagram for QVkShaderResourceBindings:

Classes

struct  BoundResourceData
 
struct  BoundSampledTextureData
 
struct  BoundStorageBufferData
 
struct  BoundStorageImageData
 
struct  BoundUniformBufferData
 

Public Member Functions

 QVkShaderResourceBindings (QRhiImplementation *rhi)
 
 ~QVkShaderResourceBindings ()
 
void destroy () override
 Releases (or requests deferred releasing of) the underlying native graphics resources.
 
bool create () override
 
void updateResources (UpdateFlags flags) override
 
- Public Member Functions inherited from QRhiShaderResourceBindings
QRhiResource::Type resourceType () const override
 
void setBindings (std::initializer_list< QRhiShaderResourceBinding > list)
 Sets the list of bindings.
 
template<typename InputIterator >
void setBindings (InputIterator first, InputIterator last)
 Sets the list of bindings from the iterators first and last.
 
const QRhiShaderResourceBindingcbeginBindings () const
 
const QRhiShaderResourceBindingcendBindings () const
 
const QRhiShaderResourceBindingbindingAt (qsizetype index) const
 
qsizetype bindingCount () const
 
bool isLayoutCompatible (const QRhiShaderResourceBindings *other) const
 
QVector< quint32serializedLayoutDescription () const
 
virtual bool create ()=0
 
virtual void updateResources (UpdateFlags flags={})=0
 
- Public Member Functions inherited from QRhiResource
virtual ~QRhiResource ()
 Destructor.
 
virtual Type resourceType () const =0
 
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
 

Public Attributes

QVarLengthArray< QRhiShaderResourceBinding, 8 > sortedBindings
 
bool hasSlottedResource = false
 
bool hasDynamicOffset = false
 
int poolIndex = -1
 
VkDescriptorSetLayout layout = VK_NULL_HANDLE
 
VkDescriptorSet descSets [QVK_FRAMES_IN_FLIGHT]
 
int lastActiveFrameSlot = -1
 
uint generation = 0
 
QVarLengthArray< BoundResourceData, 8 > boundResourceData [QVK_FRAMES_IN_FLIGHT]
 

Friends

class QRhiVulkan
 

Additional Inherited Members

- Public Types inherited from QRhiShaderResourceBindings
enum  UpdateFlag { BindingsAreSorted = 0x01 }
 
- 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 QRhiShaderResourceBindings
 QRhiShaderResourceBindings (QRhiImplementation *rhi)
 
- Protected Member Functions inherited from QRhiResource
 QRhiResource (QRhiImplementation *rhi)
 
- Protected Attributes inherited from QRhiShaderResourceBindings
QVarLengthArray< QRhiShaderResourceBinding, BINDING_PREALLOCm_bindings
 
size_t m_layoutDescHash = 0
 
QVector< quint32m_layoutDesc
 
- Protected Attributes inherited from QRhiResource
QRhiImplementationm_rhi = nullptr
 
quint64 m_id
 
QByteArray m_objectName
 
- Static Protected Attributes inherited from QRhiShaderResourceBindings
static const int BINDING_PREALLOC = 12
 

Detailed Description

Definition at line 220 of file qrhivulkan_p.h.

Constructor & Destructor Documentation

◆ QVkShaderResourceBindings()

QVkShaderResourceBindings::QVkShaderResourceBindings ( QRhiImplementation rhi)

Definition at line 6904 of file qrhivulkan.cpp.

◆ ~QVkShaderResourceBindings()

QVkShaderResourceBindings::~QVkShaderResourceBindings ( )

Definition at line 6909 of file qrhivulkan.cpp.

References destroy().

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

◆ destroy()

void QVkShaderResourceBindings::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 6914 of file qrhivulkan.cpp.

References QVarLengthArray< T, Prealloc >::clear(), descSets, e, i, lastActiveFrameSlot, layout, poolIndex, QRHI_RES_RHI, QVK_FRAMES_IN_FLIGHT, QRhiVulkan::DeferredReleaseEntry::ShaderResourceBindings, and sortedBindings.

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

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

◆ updateResources()

void QVkShaderResourceBindings::updateResources ( UpdateFlags  flags)
overridevirtual

Friends And Related Symbol Documentation

◆ QRhiVulkan

friend class QRhiVulkan
friend

Definition at line 271 of file qrhivulkan_p.h.

Member Data Documentation

◆ boundResourceData

◆ descSets

VkDescriptorSet QVkShaderResourceBindings::descSets[QVK_FRAMES_IN_FLIGHT]

◆ generation

uint QVkShaderResourceBindings::generation = 0

Definition at line 235 of file qrhivulkan_p.h.

Referenced by create(), QRhiVulkan::setShaderResources(), and updateResources().

◆ hasDynamicOffset

bool QVkShaderResourceBindings::hasDynamicOffset = false

Definition at line 230 of file qrhivulkan_p.h.

Referenced by create(), and QRhiVulkan::setShaderResources().

◆ hasSlottedResource

bool QVkShaderResourceBindings::hasSlottedResource = false

Definition at line 229 of file qrhivulkan_p.h.

Referenced by create(), and QRhiVulkan::setShaderResources().

◆ lastActiveFrameSlot

int QVkShaderResourceBindings::lastActiveFrameSlot = -1

Definition at line 234 of file qrhivulkan_p.h.

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

◆ layout

VkDescriptorSetLayout QVkShaderResourceBindings::layout = VK_NULL_HANDLE

◆ poolIndex

int QVkShaderResourceBindings::poolIndex = -1

Definition at line 231 of file qrhivulkan_p.h.

Referenced by create(), and destroy().

◆ sortedBindings


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