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

#include <qrhimetal_p.h>

Inheritance diagram for QMetalShadingRateMap:
Collaboration diagram for QMetalShadingRateMap:

Public Member Functions

 QMetalShadingRateMap (QRhiImplementation *rhi)
 ~QMetalShadingRateMap ()
void destroy () override
 Releases (or requests deferred releasing of) the underlying native graphics resources.
bool createFrom (NativeShadingRateMap src) override
 Sets up the shading rate map to use a native 3D API shading rate object src.
Public Member Functions inherited from QRhiShadingRateMap
QRhiResource::Type resourceType () const override
virtual bool createFrom (QRhiTexture *src)
 Sets up the shading rate map to use the texture src as the image containing the per-tile shading rates.
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

QMetalShadingRateMapDatad
uint generation = 0
int lastActiveFrameSlot = -1

Friends

class QRhiMetal

Additional Inherited Members

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 QRhiShadingRateMap
 QRhiShadingRateMap (QRhiImplementation *rhi)
 \variable QRhiShadingRateMap::NativeShadingRateMap::object
Protected Member Functions inherited from QRhiResource
 QRhiResource (QRhiImplementation *rhi)
Protected Attributes inherited from QRhiResource
QRhiImplementationm_rhi = nullptr
quint64 m_id
QByteArray m_objectName

Detailed Description

Definition at line 110 of file qrhimetal_p.h.

Constructor & Destructor Documentation

◆ QMetalShadingRateMap()

QMetalShadingRateMap::QMetalShadingRateMap ( QRhiImplementation * rhi)

Definition at line 4159 of file qrhimetal.mm.

References QMetalShadingRateMap(), and d.

Referenced by QMetalShadingRateMap().

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

◆ ~QMetalShadingRateMap()

QMetalShadingRateMap::~QMetalShadingRateMap ( )

Definition at line 4165 of file qrhimetal.mm.

References d, and destroy().

Here is the call graph for this function:

Member Function Documentation

◆ createFrom()

bool QMetalShadingRateMap::createFrom ( NativeShadingRateMap src)
overridevirtual

Sets up the shading rate map to use a native 3D API shading rate object src.

Returns
true when successful, false when not supported.
Note
This is functional only when the QRhi::VariableRateShadingMap feature is reported as supported, while QRhi::VariableShadingRateMapWithTexture feature is not. Currently this is true for Metal, assuming variable rate shading is supported by the GPU.
With Metal, the object field of src is expected to contain an id<MTLRasterizationRateMap>. Note that Qt does not perform anything else apart from passing the MTLRasterizationRateMap on to the MTLRenderPassDescriptor. If any special scaling is required, it is up to the application (or the XR compositor) to perform that.

Reimplemented from QRhiShadingRateMap.

Definition at line 4190 of file qrhimetal.mm.

References d, destroy(), and lastActiveFrameSlot.

Here is the call graph for this function:

◆ destroy()

void QMetalShadingRateMap::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 4171 of file qrhimetal.mm.

References d, QRhiMetal::d, lastActiveFrameSlot, QRhiMetalData::DeferredReleaseEntry::lastActiveFrameSlot, QRhiMetalData::DeferredReleaseEntry::ShadingRateMap, and QRhiMetalData::DeferredReleaseEntry::type.

Referenced by ~QMetalShadingRateMap(), and createFrom().

Here is the caller graph for this function:

◆ QRhiMetal

friend class QRhiMetal
friend

Definition at line 120 of file qrhimetal_p.h.

Member Data Documentation

◆ d

QMetalShadingRateMapData* QMetalShadingRateMap::d

Definition at line 117 of file qrhimetal_p.h.

Referenced by QMetalShadingRateMap(), ~QMetalShadingRateMap(), createFrom(), and destroy().

◆ generation

uint QMetalShadingRateMap::generation = 0

Definition at line 118 of file qrhimetal_p.h.

◆ lastActiveFrameSlot

int QMetalShadingRateMap::lastActiveFrameSlot = -1

Definition at line 119 of file qrhimetal_p.h.

Referenced by createFrom(), and destroy().


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