Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QMetalShaderResourceBindings Struct Reference

#include <qrhimetal_p.h>

Inheritance diagram for QMetalShaderResourceBindings:
Collaboration diagram for QMetalShaderResourceBindings:

Classes

struct  BoundResourceData
struct  BoundSampledTextureData
struct  BoundStorageBufferData
struct  BoundStorageImageData
struct  BoundUniformBufferData

Public Member Functions

 QMetalShaderResourceBindings (QRhiImplementation *rhi)
 ~QMetalShaderResourceBindings ()
void destroy () override
 Releases (or requests deferred releasing of) the underlying native graphics resources.
bool create () override
 Creates the corresponding resource binding set.
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
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

QVarLengthArray< QRhiShaderResourceBinding, 8 > sortedBindings
int maxBinding = -1
QVarLengthArray< BoundResourceData, 8 > boundResourceData
QMetalGraphicsPipelinelastUsedGraphicsPipeline = nullptr
QMetalComputePipelinelastUsedComputePipeline = nullptr
uint generation = 0

Friends

class QRhiMetal

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 ,
  ShadingRateMap
}
 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 constexpr int BINDING_PREALLOC = 12

Detailed Description

Definition at line 181 of file qrhimetal_p.h.

Constructor & Destructor Documentation

◆ QMetalShaderResourceBindings()

QMetalShaderResourceBindings::QMetalShaderResourceBindings ( QRhiImplementation * rhi)

Definition at line 4473 of file qrhimetal.mm.

References QMetalShaderResourceBindings().

Referenced by QMetalShaderResourceBindings().

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

◆ ~QMetalShaderResourceBindings()

QMetalShaderResourceBindings::~QMetalShaderResourceBindings ( )

Definition at line 4478 of file qrhimetal.mm.

References destroy().

Here is the call graph for this function:

Member Function Documentation

◆ create()

bool QMetalShaderResourceBindings::create ( )
overridevirtual

Creates the corresponding resource binding set.

Depending on the underlying graphics API, this may involve creating native graphics resources, and therefore it should not be assumed that this is a cheap operation.

If create() has been called before with no corresponding destroy(), then destroy() is called implicitly first.

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

Implements QRhiShaderResourceBindings.

Definition at line 4493 of file qrhimetal.mm.

References destroy(), and maxBinding.

Here is the call graph for this function:

◆ destroy()

void QMetalShaderResourceBindings::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 4483 of file qrhimetal.mm.

References maxBinding.

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

Here is the caller graph for this function:

◆ updateResources()

void QMetalShaderResourceBindings::updateResources ( UpdateFlags flags)
overridevirtual

Implements QRhiShaderResourceBindings.

Definition at line 4521 of file qrhimetal.mm.

◆ QRhiMetal

friend class QRhiMetal
friend

Definition at line 226 of file qrhimetal_p.h.

Member Data Documentation

◆ boundResourceData

QVarLengthArray<BoundResourceData, 8> QMetalShaderResourceBindings::boundResourceData

Definition at line 221 of file qrhimetal_p.h.

◆ generation

uint QMetalShaderResourceBindings::generation = 0

Definition at line 225 of file qrhimetal_p.h.

◆ lastUsedComputePipeline

QMetalComputePipeline* QMetalShaderResourceBindings::lastUsedComputePipeline = nullptr

Definition at line 223 of file qrhimetal_p.h.

Referenced by QRhiMetal::setShaderResources().

◆ lastUsedGraphicsPipeline

QMetalGraphicsPipeline* QMetalShaderResourceBindings::lastUsedGraphicsPipeline = nullptr

Definition at line 222 of file qrhimetal_p.h.

Referenced by QRhiMetal::setShaderResources().

◆ maxBinding

◆ sortedBindings

QVarLengthArray<QRhiShaderResourceBinding, 8> QMetalShaderResourceBindings::sortedBindings

Definition at line 189 of file qrhimetal_p.h.


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