![]() |
Qt 6.x
The Qt SDK
|
#include <qrhivulkan_p.h>
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 |
![]() | |
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 QRhiShaderResourceBinding * | cbeginBindings () const |
const QRhiShaderResourceBinding * | cendBindings () const |
const QRhiShaderResourceBinding * | bindingAt (qsizetype index) const |
qsizetype | bindingCount () const |
bool | isLayoutCompatible (const QRhiShaderResourceBindings *other) const |
QVector< quint32 > | serializedLayoutDescription () const |
virtual bool | create ()=0 |
virtual void | updateResources (UpdateFlags flags={})=0 |
![]() | |
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 |
QRhi * | rhi () 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 |
Definition at line 220 of file qrhivulkan_p.h.
QVkShaderResourceBindings::QVkShaderResourceBindings | ( | QRhiImplementation * | rhi | ) |
Definition at line 6904 of file qrhivulkan.cpp.
QVkShaderResourceBindings::~QVkShaderResourceBindings | ( | ) |
Definition at line 6909 of file qrhivulkan.cpp.
References destroy().
|
overridevirtual |
Implements QRhiShaderResourceBindings.
Definition at line 6940 of file qrhivulkan.cpp.
References QVarLengthArray< T, Prealloc >::append(), QVarLengthArray< T, Prealloc >::begin(), boundResourceData, QVarLengthArray< T, Prealloc >::cbegin(), QVarLengthArray< T, Prealloc >::cend(), QVarLengthArray< T, Prealloc >::clear(), QVarLengthArray< T, Prealloc >::constData(), descSets, destroy(), QRhiBuffer::Dynamic, QVarLengthArray< T, Prealloc >::end(), generation, hasDynamicOffset, hasSlottedResource, i, lastActiveFrameSlot, layout, QRhiShaderResourceBindings::m_bindings, poolIndex, QRHI_RES, QRHI_RES_RHI, QVK_FRAMES_IN_FLIGHT, qWarning, QRhiShaderResourceBinding::SampledTexture, QRhiImplementation::shaderResourceBindingData(), QVLABaseBase::size(), QRhiImplementation::sortedBindingLessThan(), sortedBindings, QRhiShaderResourceBinding::Texture, toVkDescriptorType(), toVkShaderStageFlags(), and QRhiShaderResourceBinding::UniformBuffer.
|
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 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().
|
overridevirtual |
Implements QRhiShaderResourceBindings.
Definition at line 7017 of file qrhivulkan.cpp.
References QVarLengthArray< T, Prealloc >::begin(), QRhiShaderResourceBindings::BindingsAreSorted, boundResourceData, QVarLengthArray< T, Prealloc >::cbegin(), QVarLengthArray< T, Prealloc >::cend(), QVarLengthArray< T, Prealloc >::clear(), QVarLengthArray< T, Prealloc >::end(), generation, i, QRhiShaderResourceBindings::m_bindings, Q_ASSERT, QVK_FRAMES_IN_FLIGHT, QVLABaseBase::size(), QRhiImplementation::sortedBindingLessThan(), and sortedBindings.
|
friend |
Definition at line 271 of file qrhivulkan_p.h.
QVarLengthArray<BoundResourceData, 8> QVkShaderResourceBindings::boundResourceData[QVK_FRAMES_IN_FLIGHT] |
Definition at line 269 of file qrhivulkan_p.h.
Referenced by create(), QRhiVulkan::setShaderResources(), updateResources(), and QRhiVulkan::updateShaderResourceBindings().
VkDescriptorSet QVkShaderResourceBindings::descSets[QVK_FRAMES_IN_FLIGHT] |
Definition at line 233 of file qrhivulkan_p.h.
Referenced by create(), destroy(), QRhiVulkan::setShaderResources(), and QRhiVulkan::updateShaderResourceBindings().
uint QVkShaderResourceBindings::generation = 0 |
Definition at line 235 of file qrhivulkan_p.h.
Referenced by create(), QRhiVulkan::setShaderResources(), and updateResources().
bool QVkShaderResourceBindings::hasDynamicOffset = false |
Definition at line 230 of file qrhivulkan_p.h.
Referenced by create(), and QRhiVulkan::setShaderResources().
bool QVkShaderResourceBindings::hasSlottedResource = false |
Definition at line 229 of file qrhivulkan_p.h.
Referenced by create(), and QRhiVulkan::setShaderResources().
int QVkShaderResourceBindings::lastActiveFrameSlot = -1 |
Definition at line 234 of file qrhivulkan_p.h.
Referenced by create(), destroy(), and QRhiVulkan::setShaderResources().
VkDescriptorSetLayout QVkShaderResourceBindings::layout = VK_NULL_HANDLE |
Definition at line 232 of file qrhivulkan_p.h.
Referenced by create(), QVkGraphicsPipeline::create(), QVkComputePipeline::create(), and destroy().
int QVkShaderResourceBindings::poolIndex = -1 |
Definition at line 231 of file qrhivulkan_p.h.
QVarLengthArray<QRhiShaderResourceBinding, 8> QVkShaderResourceBindings::sortedBindings |
Definition at line 228 of file qrhivulkan_p.h.
Referenced by create(), destroy(), QRhiVulkan::setShaderResources(), updateResources(), and QRhiVulkan::updateShaderResourceBindings().