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
QRhiMetal Class Reference

#include <qrhimetal_p.h>

Inheritance diagram for QRhiMetal:
Collaboration diagram for QRhiMetal:

Classes

struct  TessDrawArgs
struct  [struct].caps

Public Member Functions

 QRhiMetal (QRhiMetalInitParams *paramsparams, QRhiMetalNativeHandles *importDevice=nullptr)
 ~QRhiMetal ()
bool create (QRhi::Flags flagsflags) override
void destroy () override
QRhiGraphicsPipeline * createGraphicsPipeline () override
QRhiComputePipeline * createComputePipeline () override
QRhiShaderResourceBindings * createShaderResourceBindings () override
QRhiBuffer * createBuffer (QRhiBuffer::Type typetype, QRhiBuffer::UsageFlags usageusage, quint32 sizesize) override
QRhiRenderBuffer * createRenderBuffer (QRhiRenderBuffer::Type typetype, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flagsflags, QRhiTexture::Format backingFormatHint) override
QRhiTexture * createTexture (QRhiTexture::Format formatformat, const QSize &pixelSize, int depthdepth, int arraySize, int sampleCount, QRhiTexture::Flags flagsflags) override
QRhiSampler * createSampler (QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode u, QRhiSampler::AddressMode vv, QRhiSampler::AddressMode ww) override
QRhiTextureRenderTarget * createTextureRenderTarget (const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flagsflags) override
QRhiShadingRateMap * createShadingRateMap () override
QRhiIndirectCommandBuffer * createIndirectCommandBuffer (QRhiIndirectCommandBuffer::Type typetype, quint32 maxCommandCount) override
void buildIndirect (QRhiCommandBuffer *cb, QRhiIndirectCommandBuffer *icb, const QRhiIndirectCommandBufferBuildInfo &info) override
void executeIndirect (QRhiCommandBuffer *cb, QRhiIndirectCommandBuffer *icb, quint32 firstCommand, quint32 commandCount) override
void commitIndirectCommandBuffer (QRhiResourceUpdateBatch *u, QRhiIndirectCommandBuffer *icb) override
QRhiSwapChain * createSwapChain () override
QRhi::FrameOpResult beginFrame (QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flagsflags) override
QRhi::FrameOpResult endFrame (QRhiSwapChain *swapChain, QRhi::EndFrameFlags flagsflags) override
QRhi::FrameOpResult beginOffscreenFrame (QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flagsflags) override
QRhi::FrameOpResult endOffscreenFrame (QRhi::EndFrameFlags flagsflags) override
QRhi::FrameOpResult finish () override
void resourceUpdate (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
void beginPass (QRhiCommandBuffer *cb, QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flagsflags) override
void endPass (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
void setGraphicsPipeline (QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps) override
void setShaderResources (QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb, int dynamicOffsetCount, const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override
void setVertexInput (QRhiCommandBuffer *cb, int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings, QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat) override
void setViewport (QRhiCommandBuffer *cb, const QRhiViewport &viewport) override
void setScissor (QRhiCommandBuffer *cb, const QRhiScissor &scissor) override
void setBlendConstants (QRhiCommandBuffer *cb, const QColor &cc) override
void setStencilRef (QRhiCommandBuffer *cb, quint32 refValue) override
void setPushConstants (QRhiCommandBuffer *cb, quint32 offsetoffset, quint32 sizesize, const void *datadata) override
void setShadingRate (QRhiCommandBuffer *cb, const QSize &coarsePixelSize) override
void draw (QRhiCommandBuffer *cb, quint32 vertexCount, quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override
void drawIndexed (QRhiCommandBuffer *cb, quint32 indexCount, quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance) override
void drawIndirect (QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCountdrawCount, quint32 stridestride) override
void drawIndexedIndirect (QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCountdrawCount, quint32 stridestride) override
void debugMarkBegin (QRhiCommandBuffer *cb, const QByteArray &namename) override
void debugMarkEnd (QRhiCommandBuffer *cb) override
void debugMarkMsg (QRhiCommandBuffer *cb, const QByteArray &msg) override
void beginComputePass (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flagsflags) override
void endComputePass (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
void setComputePipeline (QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override
void dispatch (QRhiCommandBuffer *cb, int xx, int yy, int zz) override
void dispatchIndirect (QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset) override
void drawIndirectCount (QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCountmaxDrawCount, quint32 stridestride) override
void drawIndexedIndirectCount (QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCountmaxDrawCount, quint32 stridestride) override
const char * icbUnavailableReason (QMetalCommandBuffer *cbD) const
bool prepareIcbKernels ()
bool prepareIcb (quint32 maxDrawCountmaxDrawCount)
bool icbDraw (QMetalCommandBuffer *cbD, bool indexed, QMetalBuffer *indirectBufD, quint32 indirectBufferOffset, QMetalBuffer *countBufD, quint32 countBufferOffset, quint32 maxDrawCountmaxDrawCount, quint32 stridestride)
const QRhiNativeHandles * nativeHandles (QRhiCommandBuffer *cb) override
void beginExternal (QRhiCommandBuffer *cb) override
void endExternal (QRhiCommandBuffer *cb) override
double lastCompletedGpuTime (QRhiCommandBuffer *cb) override
QList< int > supportedSampleCounts () const override
QList< QSize > supportedShadingRates (int sampleCount) const override
int ubufAlignment () const override
bool isYUpInFramebuffer () const override
bool isYUpInNDC () const override
bool isClipDepthZeroToOne () const override
QMatrix4x4 clipSpaceCorrMatrix () const override
bool isTextureFormatSupported (QRhiTexture::Format formatformat, QRhiTexture::Flags flagsflags) const override
bool isFeatureSupported (QRhi::Feature feature) const override
int resourceLimit (QRhi::ResourceLimit limitlimit) const override
const QRhiNativeHandles * nativeHandles () override
QRhiDriverInfo driverInfo () const override
QRhiStats statistics () override
bool makeThreadLocalNativeContextCurrent () override
void setQueueSubmitParams (QRhiNativeHandles *paramsparams) override
void releaseCachedResources () override
bool isDeviceLost () const override
QByteArray pipelineCacheData () override
void setPipelineCacheData (const QByteArray &datadata) override
void executeDeferredReleases (bool forced=false)
void finishActiveReadbacks (bool forced=false)
qsizetype subresUploadByteSize (const QRhiTextureSubresourceUploadDescription &subresDesc) const
void enqueueSubresUpload (QMetalTexture *texD, void *mp, void *blitEncPtr, int layerlayer, int levellevel, const QRhiTextureSubresourceUploadDescription &subresDesc, qsizetype *curOfs)
void enqueueResourceUpdates (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
void executeBufferHostWritesForSlot (QMetalBuffer *bufD, int slot)
void executeBufferHostWritesForCurrentFrame (QMetalBuffer *bufD)
void finalizeDeferredStoreActions (QMetalCommandBuffer *cbD, bool passIsEnding)
void interruptRenderPass (QMetalCommandBuffer *cbD)
void enqueueShaderResourceBindings (QMetalShaderResourceBindings *srbD, QMetalCommandBuffer *cbD, int dynamicOffsetCount, const QRhiCommandBuffer::DynamicOffset *dynamicOffsets, bool offsetOnlyChange, const QShader::NativeResourceBindingMap *nativeResourceBindingMaps[SUPPORTED_STAGES], const QMetalShader *shadersshaders[SUPPORTED_STAGES])
void setDefaultScissor (QMetalCommandBuffer *cbD)
void tessellatedDraw (const TessDrawArgs &args)
void adjustForMultiViewDraw (quint32 *instanceCount, QRhiCommandBuffer *cb)
Public Member Functions inherited from QRhiImplementation
virtual ~QRhiImplementation ()
virtual QRhi::AdapterList enumerateAdaptersBeforeCreate (QRhiNativeHandles *nativeHandles) const
void prepareForCreate (QRhi *rhi, QRhi::Implementation impl, QRhi::Flags flagsflags, QRhiAdapter *adapter)
bool isCompressedFormat (QRhiTexture::Format formatformat) const
bool compressedFormatInfo (QRhiTexture::Format formatformat, const QSize &sizesize, quint32 *bpl, quint32 *byteSize, QSize *blockDim) const
bool textureFormatInfo (QRhiTexture::Format formatformat, const QSize &sizesize, quint32 *bpl, quint32 *byteSize, quint32 *bytesPerPixel) const
bool isStencilSupportingFormat (QRhiTexture::Format formatformat) const
void registerResource (QRhiResource *resres, bool ownsNativeResources=true)
void unregisterResource (QRhiResource *resres)
void addDeleteLater (QRhiResource *resres)
void addCleanupCallback (const QRhi::CleanupCallback &callback)
void addCleanupCallback (const void *keykey, const QRhi::CleanupCallback &callback)
void removeCleanupCallback (const void *keykey)
bool sanityCheckGraphicsPipeline (QRhiGraphicsPipeline *ps)
bool sanityCheckShaderResourceBindings (QRhiShaderResourceBindings *srb)
bool sanityCheckResourceOwnership (QRhiResource *maybeResource)
void updateLayoutDesc (QRhiShaderResourceBindings *srb)
quint32 pipelineCacheRhiId () const
void pipelineCreationStart ()
void pipelineCreationEnd ()
qint64 totalPipelineCreationTime () const
QRhiVertexInputAttribute::Format shaderDescVariableFormatToVertexInputFormat (QShaderDescription::VariableType typetype) const
quint32 byteSizePerVertexForVertexInputFormat (QRhiVertexInputAttribute::Format formatformat) const
int effectiveSampleCount (int sampleCount) const
QSize clampedSubResourceUploadSize (QSize sizesize, QPoint dstPos, int levellevel, QSize textureSizeAtLevelZero, bool warn=true)
QSize clampedSubResourceUploadSizeForSourceData (QSize sizesize, quint32 bpl, quint32 bytesPerPixel, qsizetype dataSizedataSize, bool warn=true)
void runCleanup ()

Static Public Member Functions

static bool probe (QRhiMetalInitParams *paramsparams)
static QRhiSwapChainProxyData updateSwapChainProxyData (QWindow *window)
static QSize outputSizeForTarget (QRhiRenderTarget *targettarget)
Static Public Member Functions inherited from QRhiImplementation
static QRhiImplementation * newInstance (QRhi::Implementation impl, QRhiInitParams *paramsparams, QRhiNativeHandles *importDevice)
static const QRhiShaderResourceBinding::Data * shaderResourceBindingData (const QRhiShaderResourceBinding &binding)
static QRhiShaderResourceBinding::Data * shaderResourceBindingData (QRhiShaderResourceBinding &binding)
static bool sortedBindingLessThan (const QRhiShaderResourceBinding &aa, const QRhiShaderResourceBinding &bb)

Public Attributes

QRhi::Flags rhiFlags
bool importedDevice = false
bool importedCmdQueue = false
QMetalSwapChain * currentSwapChain = nullptr
QSet< QMetalSwapChain * > swapchains
QRhiMetalNativeHandles nativeHandlesStruct
QRhiDriverInfo driverInfoStruct
quint32 osMajor = 0
quint32 osMinor = 0
struct  caps
QRhiMetalData * d = nullptr
Public Attributes inherited from QRhiImplementation
QRhi * q
bool debugMarkers = false
bool timestamps = false
int currentFrameSlot = 0
bool inFrame = false
QRhiCommandBuffer * currentOffscreenCb = nullptr
QRhiAdapter * requestedRhiAdapter = nullptr
QHash< QRhiResource *, bool > resources

Static Public Attributes

static const int SUPPORTED_STAGES = 5
Static Public Attributes inherited from QRhiImplementation
static const int MAX_SHADER_CACHE_ENTRIES = 128
static const quint32 MAX_BINARY_CACHE_BYTES = 16 * 1024 * 1024

Detailed Description

Definition at line 389 of file qrhimetal_p.h.

Constructor & Destructor Documentation

◆ QRhiMetal()

QRhiMetal::QRhiMetal ( QRhiMetalInitParams * params,
QRhiMetalNativeHandles * importDevice = nullptr )

Definition at line 577 of file qrhimetal.mm.

References QRhiMetalData::QRhiMetalData(), d, importedCmdQueue, and importedDevice.

Here is the call graph for this function:

◆ ~QRhiMetal()

QRhiMetal::~QRhiMetal ( )

Definition at line 597 of file qrhimetal.mm.

References d.

Member Function Documentation

◆ adjustForMultiViewDraw()

◆ beginComputePass()

void QRhiMetal::beginComputePass ( QRhiCommandBuffer * cb,
QRhiResourceUpdateBatch * resourceUpdates,
QRhiCommandBuffer::BeginPassFlags flags )
overridevirtual

Implements QRhiImplementation.

Definition at line 4268 of file qrhimetal.mm.

References QMetalCommandBuffer::ComputePass, QMetalCommandBuffer::d, enqueueResourceUpdates(), QMetalCommandBuffer::NoPass, QMetalCommandBuffer::recordingPass, and QMetalCommandBuffer::resetPerPassState().

Here is the call graph for this function:

◆ beginExternal()

void QRhiMetal::beginExternal ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 3281 of file qrhimetal.mm.

◆ beginFrame()

QRhi::FrameOpResult QRhiMetal::beginFrame ( QRhiSwapChain * swapChain,
QRhi::BeginFrameFlags flags )
overridevirtual

◆ beginOffscreenFrame()

QRhi::FrameOpResult QRhiMetal::beginOffscreenFrame ( QRhiCommandBuffer ** cb,
QRhi::BeginFrameFlags flags )
overridevirtual

Implements QRhiImplementation.

Definition at line 3456 of file qrhimetal.mm.

References d, executeDeferredReleases(), finishActiveReadbacks(), and QRhiMetalData::resetAndResizeBufferStagingArea().

Here is the call graph for this function:

◆ beginPass()

◆ buildIndirect()

◆ clipSpaceCorrMatrix()

QMatrix4x4 QRhiMetal::clipSpaceCorrMatrix ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 888 of file qrhimetal.mm.

◆ commitIndirectCommandBuffer()

void QRhiMetal::commitIndirectCommandBuffer ( QRhiResourceUpdateBatch * u,
QRhiIndirectCommandBuffer * icb )
overridevirtual

Reimplemented from QRhiImplementation.

Definition at line 4586 of file qrhimetal.mm.

◆ create()

bool QRhiMetal::create ( QRhi::Flags flags)
overridevirtual

Implements QRhiImplementation.

Definition at line 653 of file qrhimetal.mm.

References d, importedCmdQueue, and importedDevice.

◆ createBuffer()

QRhiBuffer * QRhiMetal::createBuffer ( QRhiBuffer::Type type,
QRhiBuffer::UsageFlags usage,
quint32 size )
overridevirtual

Implements QRhiImplementation.

Definition at line 863 of file qrhimetal.mm.

◆ createComputePipeline()

QRhiComputePipeline * QRhiMetal::createComputePipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1309 of file qrhimetal.mm.

◆ createGraphicsPipeline()

QRhiGraphicsPipeline * QRhiMetal::createGraphicsPipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1304 of file qrhimetal.mm.

◆ createIndirectCommandBuffer()

QRhiIndirectCommandBuffer * QRhiMetal::createIndirectCommandBuffer ( QRhiIndirectCommandBuffer::Type type,
quint32 maxCommandCount )
overridevirtual

Reimplemented from QRhiImplementation.

Definition at line 4580 of file qrhimetal.mm.

◆ createRenderBuffer()

QRhiRenderBuffer * QRhiMetal::createRenderBuffer ( QRhiRenderBuffer::Type type,
const QSize & pixelSize,
int sampleCount,
QRhiRenderBuffer::Flags flags,
QRhiTexture::Format backingFormatHint )
overridevirtual

Implements QRhiImplementation.

Definition at line 1272 of file qrhimetal.mm.

◆ createSampler()

QRhiSampler * QRhiMetal::createSampler ( QRhiSampler::Filter magFilter,
QRhiSampler::Filter minFilter,
QRhiSampler::Filter mipmapMode,
QRhiSampler::AddressMode u,
QRhiSampler::AddressMode v,
QRhiSampler::AddressMode w )
overridevirtual

Implements QRhiImplementation.

Definition at line 1286 of file qrhimetal.mm.

◆ createShaderResourceBindings()

QRhiShaderResourceBindings * QRhiMetal::createShaderResourceBindings ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1314 of file qrhimetal.mm.

◆ createShadingRateMap()

QRhiShadingRateMap * QRhiMetal::createShadingRateMap ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1293 of file qrhimetal.mm.

◆ createSwapChain()

QRhiSwapChain * QRhiMetal::createSwapChain ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 858 of file qrhimetal.mm.

◆ createTexture()

QRhiTexture * QRhiMetal::createTexture ( QRhiTexture::Format format,
const QSize & pixelSize,
int depth,
int arraySize,
int sampleCount,
QRhiTexture::Flags flags )
overridevirtual

Implements QRhiImplementation.

Definition at line 1279 of file qrhimetal.mm.

◆ createTextureRenderTarget()

QRhiTextureRenderTarget * QRhiMetal::createTextureRenderTarget ( const QRhiTextureRenderTargetDescription & desc,
QRhiTextureRenderTarget::Flags flags )
overridevirtual

Implements QRhiImplementation.

Definition at line 1298 of file qrhimetal.mm.

◆ debugMarkBegin()

void QRhiMetal::debugMarkBegin ( QRhiCommandBuffer * cb,
const QByteArray & name )
overridevirtual

Implements QRhiImplementation.

Definition at line 3215 of file qrhimetal.mm.

References QMetalCommandBuffer::d, and QMetalCommandBuffer::recordingPass.

◆ debugMarkEnd()

void QRhiMetal::debugMarkEnd ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 3236 of file qrhimetal.mm.

References QMetalCommandBuffer::d, and QMetalCommandBuffer::recordingPass.

◆ debugMarkMsg()

void QRhiMetal::debugMarkMsg ( QRhiCommandBuffer * cb,
const QByteArray & msg )
overridevirtual

Implements QRhiImplementation.

Definition at line 3257 of file qrhimetal.mm.

References QMetalCommandBuffer::recordingPass.

◆ destroy()

void QRhiMetal::destroy ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 781 of file qrhimetal.mm.

References d, executeDeferredReleases(), finishActiveReadbacks(), QRhiMetalData::icbSetupFailed, importedCmdQueue, and importedDevice.

Here is the call graph for this function:

◆ dispatch()

void QRhiMetal::dispatch ( QRhiCommandBuffer * cb,
int x,
int y,
int z )
overridevirtual

◆ dispatchIndirect()

void QRhiMetal::dispatchIndirect ( QRhiCommandBuffer * cb,
QRhiBuffer * indirectBuffer,
quint32 indirectBufferOffset )
overridevirtual

Implements QRhiImplementation.

Definition at line 4322 of file qrhimetal.mm.

References QMetalCommandBuffer::ComputePass, QMetalCommandBuffer::currentComputePipeline, executeBufferHostWritesForCurrentFrame(), QMetalBuffer::lastActiveFrameSlot, and QMetalCommandBuffer::recordingPass.

Here is the call graph for this function:

◆ draw()

void QRhiMetal::draw ( QRhiCommandBuffer * cb,
quint32 vertexCount,
quint32 instanceCount,
quint32 firstVertex,
quint32 firstInstance )
overridevirtual

Implements QRhiImplementation.

Definition at line 2794 of file qrhimetal.mm.

References QRhiMetal::TessDrawArgs::cbD, QMetalCommandBuffer::currentGraphicsPipeline, QMetalGraphicsPipeline::d, QRhiMetal::TessDrawArgs::NonIndexed, QMetalCommandBuffer::recordingPass, QMetalCommandBuffer::RenderPass, and tessellatedDraw().

Here is the call graph for this function:

◆ drawIndexed()

void QRhiMetal::drawIndexed ( QRhiCommandBuffer * cb,
quint32 indexCount,
quint32 instanceCount,
quint32 firstIndex,
qint32 vertexOffset,
quint32 firstInstance )
overridevirtual

Implements QRhiImplementation.

Definition at line 2823 of file qrhimetal.mm.

References QRhiMetal::TessDrawArgs::cbD, QMetalCommandBuffer::currentGraphicsPipeline, QMetalCommandBuffer::currentIndexBuffer, QMetalGraphicsPipeline::d, QMetalCommandBuffer::recordingPass, QMetalCommandBuffer::RenderPass, and tessellatedDraw().

Here is the call graph for this function:

◆ drawIndexedIndirect()

void QRhiMetal::drawIndexedIndirect ( QRhiCommandBuffer * cb,
QRhiBuffer * indirectBuffer,
quint32 indirectBufferOffset,
quint32 drawCount,
quint32 stride )
overridevirtual

Implements QRhiImplementation.

Definition at line 3179 of file qrhimetal.mm.

References QMetalCommandBuffer::currentIndexBuffer, executeBufferHostWritesForCurrentFrame(), QMetalBuffer::lastActiveFrameSlot, QMetalCommandBuffer::recordingPass, and QMetalCommandBuffer::RenderPass.

Here is the call graph for this function:

◆ drawIndexedIndirectCount()

void QRhiMetal::drawIndexedIndirectCount ( QRhiCommandBuffer * cb,
QRhiBuffer * indirectBuffer,
quint32 indirectBufferOffset,
QRhiBuffer * countBuffer,
quint32 countBufferOffset,
quint32 maxDrawCount,
quint32 stride )
overridevirtual

Implements QRhiImplementation.

Definition at line 4364 of file qrhimetal.mm.

References QMetalCommandBuffer::currentIndexBuffer, icbUnavailableReason(), QMetalCommandBuffer::recordingPass, and QMetalCommandBuffer::RenderPass.

Here is the call graph for this function:

◆ drawIndirect()

void QRhiMetal::drawIndirect ( QRhiCommandBuffer * cb,
QRhiBuffer * indirectBuffer,
quint32 indirectBufferOffset,
quint32 drawCount,
quint32 stride )
overridevirtual

Implements QRhiImplementation.

Definition at line 3152 of file qrhimetal.mm.

References executeBufferHostWritesForCurrentFrame(), QMetalBuffer::lastActiveFrameSlot, QMetalCommandBuffer::recordingPass, and QMetalCommandBuffer::RenderPass.

Here is the call graph for this function:

◆ drawIndirectCount()

void QRhiMetal::drawIndirectCount ( QRhiCommandBuffer * cb,
QRhiBuffer * indirectBuffer,
quint32 indirectBufferOffset,
QRhiBuffer * countBuffer,
quint32 countBufferOffset,
quint32 maxDrawCount,
quint32 stride )
overridevirtual

Implements QRhiImplementation.

Definition at line 4345 of file qrhimetal.mm.

References icbUnavailableReason(), QMetalCommandBuffer::recordingPass, and QMetalCommandBuffer::RenderPass.

Here is the call graph for this function:

◆ driverInfo()

QRhiDriverInfo QRhiMetal::driverInfo ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 1111 of file qrhimetal.mm.

◆ endComputePass()

void QRhiMetal::endComputePass ( QRhiCommandBuffer * cb,
QRhiResourceUpdateBatch * resourceUpdates )
overridevirtual

Implements QRhiImplementation.

Definition at line 4283 of file qrhimetal.mm.

References QMetalCommandBuffer::ComputePass, enqueueResourceUpdates(), QMetalCommandBuffer::NoPass, and QMetalCommandBuffer::recordingPass.

Here is the call graph for this function:

◆ endExternal()

void QRhiMetal::endExternal ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 3286 of file qrhimetal.mm.

References QMetalCommandBuffer::resetPerPassCachedState().

Here is the call graph for this function:

◆ endFrame()

QRhi::FrameOpResult QRhiMetal::endFrame ( QRhiSwapChain * swapChain,
QRhi::EndFrameFlags flags )
overridevirtual

◆ endOffscreenFrame()

QRhi::FrameOpResult QRhiMetal::endOffscreenFrame ( QRhi::EndFrameFlags flags)
overridevirtual

Implements QRhiImplementation.

Definition at line 3481 of file qrhimetal.mm.

References d, and finishActiveReadbacks().

Here is the call graph for this function:

◆ endPass()

void QRhiMetal::endPass ( QRhiCommandBuffer * cb,
QRhiResourceUpdateBatch * resourceUpdates )
overridevirtual

Implements QRhiImplementation.

Definition at line 4253 of file qrhimetal.mm.

References enqueueResourceUpdates(), finalizeDeferredStoreActions(), QMetalCommandBuffer::NoPass, QMetalCommandBuffer::recordingPass, and QMetalCommandBuffer::RenderPass.

Here is the call graph for this function:

◆ enqueueResourceUpdates()

void QRhiMetal::enqueueResourceUpdates ( QRhiCommandBuffer * cb,
QRhiResourceUpdateBatch * resourceUpdates )

Definition at line 3727 of file qrhimetal.mm.

References QRhiResourceUpdateBatchPrivate::activeBufferOpCount, QRhiMetalData::BufferReadback::activeFrameSlot, QRhiMetalData::TextureReadback::activeFrameSlot, QRhiResourceUpdateBatchPrivate::activeTextureOpCount, QRhiResourceUpdateBatchPrivate::BufferOp::Clear, QRhiResourceUpdateBatchPrivate::BufferOp::Copy, QRhiResourceUpdateBatchPrivate::TextureOp::Copy, currentSwapChain, QMetalBuffer::d, QMetalSwapChain::d, QMetalSwapChainRenderTarget::d, QMetalTexture::d, d, QRhiMetalData::TextureReadback::depthPlaneIsFloat, QRhiResourceUpdateBatchPrivate::TextureOp::dst, QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate, executeBufferHostWritesForCurrentFrame(), executeBufferHostWritesForSlot(), QRhiResourceUpdateBatchPrivate::free(), QRhiResourceUpdateBatchPrivate::TextureOp::GenMips, QRhiResourceUpdateBatchPrivate::get(), QMetalBufferData::isDeviceLocal, QMetalBuffer::lastActiveFrameSlot, QMetalTexture::lastActiveFrameSlot, QRhiMetalData::DeferredReleaseEntry::lastActiveFrameSlot, QRhiResourceUpdateBatchPrivate::BufferOp::Read, QRhiResourceUpdateBatchPrivate::TextureOp::Read, QMetalSwapChain::rtWrapper, QMetalTexture::samples, QMetalBufferData::slotted, QRhiResourceUpdateBatchPrivate::TextureOp::src, QRhiMetalData::DeferredReleaseEntry::StagingBuffer, QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload, QRhiMetalData::DeferredReleaseEntry::type, QRhiResourceUpdateBatchPrivate::BufferOp::type, QRhiResourceUpdateBatchPrivate::TextureOp::type, and QRhiResourceUpdateBatchPrivate::TextureOp::Upload.

Referenced by beginComputePass(), beginPass(), endComputePass(), endPass(), and resourceUpdate().

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

◆ enqueueShaderResourceBindings()

◆ enqueueSubresUpload()

void QRhiMetal::enqueueSubresUpload ( QMetalTexture * texD,
void * mp,
void * blitEncPtr,
int layer,
int level,
const QRhiTextureSubresourceUploadDescription & subresDesc,
qsizetype * curOfs )

Definition at line 3591 of file qrhimetal.mm.

◆ executeBufferHostWritesForCurrentFrame()

void QRhiMetal::executeBufferHostWritesForCurrentFrame ( QMetalBuffer * bufD)

Definition at line 4054 of file qrhimetal.mm.

References executeBufferHostWritesForSlot().

Referenced by buildIndirect(), dispatchIndirect(), drawIndexedIndirect(), drawIndirect(), enqueueResourceUpdates(), icbDraw(), setShaderResources(), and setVertexInput().

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

◆ executeBufferHostWritesForSlot()

void QRhiMetal::executeBufferHostWritesForSlot ( QMetalBuffer * bufD,
int slot )

Definition at line 4029 of file qrhimetal.mm.

References QMetalBuffer::d, and QMetalBufferData::isDeviceLocal.

Referenced by enqueueResourceUpdates(), executeBufferHostWritesForCurrentFrame(), and QMetalBuffer::nativeBuffer().

Here is the caller graph for this function:

◆ executeDeferredReleases()

void QRhiMetal::executeDeferredReleases ( bool forced = false)

Definition at line 4952 of file qrhimetal.mm.

References QRhiMetalData::DeferredReleaseEntry::Buffer, d, qrhimtl_releaseBuffer(), qrhimtl_releaseRenderBuffer(), qrhimtl_releaseSampler(), qrhimtl_releaseTexture(), QRhiMetalData::DeferredReleaseEntry::RenderBuffer, QRhiMetalData::DeferredReleaseEntry::Sampler, QRhiMetalData::DeferredReleaseEntry::Texture, and QRhiMetalData::DeferredReleaseEntry::type.

Referenced by beginFrame(), beginOffscreenFrame(), destroy(), and finish().

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

◆ executeIndirect()

◆ finalizeDeferredStoreActions()

void QRhiMetal::finalizeDeferredStoreActions ( QMetalCommandBuffer * cbD,
bool passIsEnding )

Definition at line 2442 of file qrhimetal.mm.

Referenced by endPass(), and interruptRenderPass().

Here is the caller graph for this function:

◆ finish()

QRhi::FrameOpResult QRhiMetal::finish ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 3500 of file qrhimetal.mm.

References currentSwapChain, d, executeDeferredReleases(), finishActiveReadbacks(), and QMetalCommandBuffer::NoPass.

Here is the call graph for this function:

◆ finishActiveReadbacks()

void QRhiMetal::finishActiveReadbacks ( bool forced = false)

Definition at line 5003 of file qrhimetal.mm.

References d, and QRhiMetalData::TextureReadback::depthPlaneIsFloat.

Referenced by beginFrame(), beginOffscreenFrame(), destroy(), endOffscreenFrame(), and finish().

Here is the caller graph for this function:

◆ icbDraw()

bool QRhiMetal::icbDraw ( QMetalCommandBuffer * cbD,
bool indexed,
QMetalBuffer * indirectBufD,
quint32 indirectBufferOffset,
QMetalBuffer * countBufD,
quint32 countBufferOffset,
quint32 maxDrawCount,
quint32 stride )

◆ icbUnavailableReason()

const char * QRhiMetal::icbUnavailableReason ( QMetalCommandBuffer * cbD) const

Definition at line 2874 of file qrhimetal.mm.

References QMetalCommandBuffer::currentGraphicsPipeline, QMetalGraphicsPipeline::d, and QMetalGraphicsPipelineData::icbCapable.

Referenced by drawIndexedIndirectCount(), drawIndirectCount(), and executeIndirect().

Here is the caller graph for this function:

◆ interruptRenderPass()

void QRhiMetal::interruptRenderPass ( QMetalCommandBuffer * cbD)

Definition at line 2460 of file qrhimetal.mm.

References QMetalCommandBuffer::d, and finalizeDeferredStoreActions().

Referenced by icbDraw(), and tempComputeEncoder().

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

◆ isClipDepthZeroToOne()

bool QRhiMetal::isClipDepthZeroToOne ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 883 of file qrhimetal.mm.

◆ isDeviceLost()

bool QRhiMetal::isDeviceLost ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 1142 of file qrhimetal.mm.

◆ isFeatureSupported()

bool QRhiMetal::isFeatureSupported ( QRhi::Feature feature) const
overridevirtual

Implements QRhiImplementation.

Definition at line 932 of file qrhimetal.mm.

◆ isTextureFormatSupported()

bool QRhiMetal::isTextureFormatSupported ( QRhiTexture::Format format,
QRhiTexture::Flags flags ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 899 of file qrhimetal.mm.

◆ isYUpInFramebuffer()

bool QRhiMetal::isYUpInFramebuffer ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 873 of file qrhimetal.mm.

◆ isYUpInNDC()

bool QRhiMetal::isYUpInNDC ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 878 of file qrhimetal.mm.

◆ lastCompletedGpuTime()

double QRhiMetal::lastCompletedGpuTime ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 3292 of file qrhimetal.mm.

References QMetalCommandBuffer::d, and QMetalCommandBufferData::lastGpuTime.

◆ makeThreadLocalNativeContextCurrent()

bool QRhiMetal::makeThreadLocalNativeContextCurrent ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1123 of file qrhimetal.mm.

◆ nativeHandles() [1/2]

const QRhiNativeHandles * QRhiMetal::nativeHandles ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1106 of file qrhimetal.mm.

◆ nativeHandles() [2/2]

const QRhiNativeHandles * QRhiMetal::nativeHandles ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 3276 of file qrhimetal.mm.

◆ outputSizeForTarget()

QSize QRhiMetal::outputSizeForTarget ( QRhiRenderTarget * target)
static

Definition at line 2227 of file qrhimetal.mm.

◆ pipelineCacheData()

QByteArray QRhiMetal::pipelineCacheData ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1157 of file qrhimetal.mm.

References QMetalPipelineCacheDataHeader::driver, and f().

Here is the call graph for this function:

◆ prepareIcb()

bool QRhiMetal::prepareIcb ( quint32 maxDrawCount)

Definition at line 2953 of file qrhimetal.mm.

References d, QRhiMetalData::DeferredReleaseEntry::lastActiveFrameSlot, prepareIcbKernels(), QRhiMetalData::DeferredReleaseEntry::StagingIcbBuffer, and QRhiMetalData::DeferredReleaseEntry::type.

Here is the call graph for this function:

◆ prepareIcbKernels()

bool QRhiMetal::prepareIcbKernels ( )

Definition at line 2894 of file qrhimetal.mm.

References d, and QRhiMetalData::icbSetupFailed.

Referenced by prepareIcb(), and qrhimtl_ensureIcbSlots().

Here is the caller graph for this function:

◆ probe()

bool QRhiMetal::probe ( QRhiMetalInitParams * params)
static

Definition at line 608 of file qrhimetal.mm.

◆ releaseCachedResources()

void QRhiMetal::releaseCachedResources ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1134 of file qrhimetal.mm.

References d.

◆ resourceLimit()

int QRhiMetal::resourceLimit ( QRhi::ResourceLimit limit) const
overridevirtual

Implements QRhiImplementation.

Definition at line 1062 of file qrhimetal.mm.

◆ resourceUpdate()

void QRhiMetal::resourceUpdate ( QRhiCommandBuffer * cb,
QRhiResourceUpdateBatch * resourceUpdates )
overridevirtual

Implements QRhiImplementation.

Definition at line 4059 of file qrhimetal.mm.

References enqueueResourceUpdates().

Here is the call graph for this function:

◆ setBlendConstants()

void QRhiMetal::setBlendConstants ( QRhiCommandBuffer * cb,
const QColor & c )
overridevirtual

◆ setComputePipeline()

◆ setDefaultScissor()

void QRhiMetal::setDefaultScissor ( QMetalCommandBuffer * cbD)

Definition at line 2250 of file qrhimetal.mm.

References Bounded, and QMetalCommandBuffer::hasCustomScissorSet.

Referenced by endTempComputeEncoding(), setGraphicsPipeline(), and setViewport().

Here is the caller graph for this function:

◆ setGraphicsPipeline()

◆ setPipelineCacheData()

void QRhiMetal::setPipelineCacheData ( const QByteArray & data)
overridevirtual

Implements QRhiImplementation.

Definition at line 1210 of file qrhimetal.mm.

References d, and QMetalPipelineCacheDataHeader::driver.

◆ setPushConstants()

◆ setQueueSubmitParams()

void QRhiMetal::setQueueSubmitParams ( QRhiNativeHandles * params)
overridevirtual

Implements QRhiImplementation.

Definition at line 1129 of file qrhimetal.mm.

◆ setScissor()

◆ setShaderResources()

void QRhiMetal::setShaderResources ( QRhiCommandBuffer * cb,
QRhiShaderResourceBindings * srb,
int dynamicOffsetCount,
const QRhiCommandBuffer::DynamicOffset * dynamicOffsets )
overridevirtual

◆ setShadingRate()

void QRhiMetal::setShadingRate ( QRhiCommandBuffer * cb,
const QSize & coarsePixelSize )
overridevirtual

Implements QRhiImplementation.

Definition at line 2401 of file qrhimetal.mm.

◆ setStencilRef()

void QRhiMetal::setStencilRef ( QRhiCommandBuffer * cb,
quint32 refValue )
overridevirtual

◆ setVertexInput()

void QRhiMetal::setVertexInput ( QRhiCommandBuffer * cb,
int startBinding,
int bindingCount,
const QRhiCommandBuffer::VertexInput * bindings,
QRhiBuffer * indexBuf,
quint32 indexOffset,
QRhiCommandBuffer::IndexFormat indexFormat )
overridevirtual

◆ setViewport()

void QRhiMetal::setViewport ( QRhiCommandBuffer * cb,
const QRhiViewport & viewport )
overridevirtual

Implements QRhiImplementation.

Definition at line 2276 of file qrhimetal.mm.

References QMetalCommandBuffer::currentGraphicsPipeline, QMetalCommandBuffer::recordingPass, QMetalCommandBuffer::RenderPass, setDefaultScissor(), and UnBounded.

Here is the call graph for this function:

◆ statistics()

QRhiStats QRhiMetal::statistics ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1116 of file qrhimetal.mm.

◆ subresUploadByteSize()

qsizetype QRhiMetal::subresUploadByteSize ( const QRhiTextureSubresourceUploadDescription & subresDesc) const

Definition at line 3581 of file qrhimetal.mm.

◆ supportedSampleCounts()

QVector< int > QRhiMetal::supportedSampleCounts ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 847 of file qrhimetal.mm.

◆ supportedShadingRates()

QVector< QSize > QRhiMetal::supportedShadingRates ( int sampleCount) const
overridevirtual

Implements QRhiImplementation.

Definition at line 852 of file qrhimetal.mm.

◆ tessellatedDraw()

◆ ubufAlignment()

int QRhiMetal::ubufAlignment ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 868 of file qrhimetal.mm.

Referenced by enqueueShaderResourceBindings().

Here is the caller graph for this function:

◆ updateSwapChainProxyData()

QRhiSwapChainProxyData QRhiMetal::updateSwapChainProxyData ( QWindow * window)
static

Definition at line 8409 of file qrhimetal.mm.

References QRhiSwapChainProxyData::reserved.

Member Data Documentation

◆ caps

struct QRhiMetal::[struct].caps QRhiMetal::caps

◆ currentSwapChain

QMetalSwapChain* QRhiMetal::currentSwapChain = nullptr

Definition at line 599 of file qrhimetal_p.h.

Referenced by beginFrame(), beginPass(), endFrame(), enqueueResourceUpdates(), and finish().

◆ d

◆ driverInfoStruct

QRhiDriverInfo QRhiMetal::driverInfoStruct

Definition at line 602 of file qrhimetal_p.h.

◆ importedCmdQueue

bool QRhiMetal::importedCmdQueue = false

Definition at line 598 of file qrhimetal_p.h.

Referenced by QRhiMetal(), create(), and destroy().

◆ importedDevice

bool QRhiMetal::importedDevice = false

Definition at line 597 of file qrhimetal_p.h.

Referenced by QRhiMetal(), create(), and destroy().

◆ nativeHandlesStruct

QRhiMetalNativeHandles QRhiMetal::nativeHandlesStruct

Definition at line 601 of file qrhimetal_p.h.

◆ osMajor

quint32 QRhiMetal::osMajor = 0

Definition at line 603 of file qrhimetal_p.h.

◆ osMinor

quint32 QRhiMetal::osMinor = 0

Definition at line 604 of file qrhimetal_p.h.

◆ rhiFlags

QRhi::Flags QRhiMetal::rhiFlags

Definition at line 596 of file qrhimetal_p.h.

◆ SUPPORTED_STAGES

const int QRhiMetal::SUPPORTED_STAGES = 5
static

Definition at line 556 of file qrhimetal_p.h.

Referenced by enqueueShaderResourceBindings(), and setShaderResources().

◆ swapchains

QSet<QMetalSwapChain *> QRhiMetal::swapchains

Definition at line 600 of file qrhimetal_p.h.


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