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

Public Member Functions

 QRhiMetal (QRhiMetalInitParams *params, QRhiMetalNativeHandles *importDevice=nullptr)
 ~QRhiMetal ()
bool create (QRhi::Flags flags) override
void destroy () override
QRhiGraphicsPipelinecreateGraphicsPipeline () override
QRhiComputePipelinecreateComputePipeline () override
QRhiShaderResourceBindingscreateShaderResourceBindings () override
QRhiBuffercreateBuffer (QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size) override
QRhiRenderBuffercreateRenderBuffer (QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint) override
QRhiTexturecreateTexture (QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags) override
QRhiSamplercreateSampler (QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode u, QRhiSampler::AddressMode v, QRhiSampler::AddressMode w) override
QRhiTextureRenderTargetcreateTextureRenderTarget (const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags) override
QRhiShadingRateMapcreateShadingRateMap () override
QRhiIndirectCommandBuffercreateIndirectCommandBuffer (QRhiIndirectCommandBuffer::Type type, 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
QRhiSwapChaincreateSwapChain () override
QRhi::FrameOpResult beginFrame (QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override
QRhi::FrameOpResult endFrame (QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override
QRhi::FrameOpResult beginOffscreenFrame (QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override
QRhi::FrameOpResult endOffscreenFrame (QRhi::EndFrameFlags flags) 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 flags) 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 &c) override
void setStencilRef (QRhiCommandBuffer *cb, quint32 refValue) 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 drawCount, quint32 stride) override
void drawIndexedIndirect (QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride) override
void debugMarkBegin (QRhiCommandBuffer *cb, const QByteArray &name) override
void debugMarkEnd (QRhiCommandBuffer *cb) override
void debugMarkMsg (QRhiCommandBuffer *cb, const QByteArray &msg) override
void beginComputePass (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates, QRhiCommandBuffer::BeginPassFlags flags) override
void endComputePass (QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override
void setComputePipeline (QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override
void dispatch (QRhiCommandBuffer *cb, int x, int y, int z) override
void dispatchIndirect (QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset) override
void drawIndirectCount (QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
void drawIndexedIndirectCount (QRhiCommandBuffer *cb, QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride) override
const char * icbUnavailableReason (QMetalCommandBuffer *cbD) const
bool prepareIcbKernels ()
bool prepareIcb (quint32 maxDrawCount)
bool icbDraw (QMetalCommandBuffer *cbD, bool indexed, QMetalBuffer *indirectBufD, quint32 indirectBufferOffset, QMetalBuffer *countBufD, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride)
const QRhiNativeHandlesnativeHandles (QRhiCommandBuffer *cb) override
void beginExternal (QRhiCommandBuffer *cb) override
void endExternal (QRhiCommandBuffer *cb) override
double lastCompletedGpuTime (QRhiCommandBuffer *cb) override
QList< int > supportedSampleCounts () const override
QList< QSizesupportedShadingRates (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 format, QRhiTexture::Flags flags) const override
bool isFeatureSupported (QRhi::Feature feature) const override
int resourceLimit (QRhi::ResourceLimit limit) const override
const QRhiNativeHandlesnativeHandles () override
QRhiDriverInfo driverInfo () const override
QRhiStats statistics () override
bool makeThreadLocalNativeContextCurrent () override
void setQueueSubmitParams (QRhiNativeHandles *params) override
void releaseCachedResources () override
bool isDeviceLost () const override
QByteArray pipelineCacheData () override
void setPipelineCacheData (const QByteArray &data) 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 layer, int level, 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 *shaders[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 flags, QRhiAdapter *adapter)
bool isCompressedFormat (QRhiTexture::Format format) const
bool compressedFormatInfo (QRhiTexture::Format format, const QSize &size, quint32 *bpl, quint32 *byteSize, QSize *blockDim) const
bool textureFormatInfo (QRhiTexture::Format format, const QSize &size, quint32 *bpl, quint32 *byteSize, quint32 *bytesPerPixel) const
bool isStencilSupportingFormat (QRhiTexture::Format format) const
void registerResource (QRhiResource *res, bool ownsNativeResources=true)
void unregisterResource (QRhiResource *res)
void addDeleteLater (QRhiResource *res)
void addCleanupCallback (const QRhi::CleanupCallback &callback)
void addCleanupCallback (const void *key, const QRhi::CleanupCallback &callback)
void removeCleanupCallback (const void *key)
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 type) const
quint32 byteSizePerVertexForVertexInputFormat (QRhiVertexInputAttribute::Format format) const
int effectiveSampleCount (int sampleCount) const
QSize clampedSubResourceUploadSize (QSize size, QPoint dstPos, int level, QSize textureSizeAtLevelZero, bool warn=true)
QSize clampedSubResourceUploadSizeForSourceData (QSize size, quint32 bpl, quint32 bytesPerPixel, qsizetype dataSize, bool warn=true)
void runCleanup ()

Static Public Member Functions

static bool probe (QRhiMetalInitParams *params)
static QRhiSwapChainProxyData updateSwapChainProxyData (QWindow *window)
Static Public Member Functions inherited from QRhiImplementation
static QRhiImplementationnewInstance (QRhi::Implementation impl, QRhiInitParams *params, QRhiNativeHandles *importDevice)
static const QRhiShaderResourceBinding::DatashaderResourceBindingData (const QRhiShaderResourceBinding &binding)
static QRhiShaderResourceBinding::DatashaderResourceBindingData (QRhiShaderResourceBinding &binding)
static bool sortedBindingLessThan (const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b)

Public Attributes

QRhi::Flags rhiFlags
bool importedDevice = false
bool importedCmdQueue = false
QMetalSwapChaincurrentSwapChain = nullptr
QSet< QMetalSwapChain * > swapchains
QRhiMetalNativeHandles nativeHandlesStruct
QRhiDriverInfo driverInfoStruct
quint32 osMajor = 0
quint32 osMinor = 0
struct { 
   int   maxTextureSize = 4096 
   bool   baseVertexAndInstance = true 
   QVector< int >   supportedSampleCounts 
   bool   isAppleGPU = false 
   int   maxThreadGroupSize = 512 
   bool   multiView = false 
   bool   indirectCommandBuffers = false 
   bool   shadingRateMap = false 
   bool   depthClamp = true 
caps
QRhiMetalDatad = nullptr
Public Attributes inherited from QRhiImplementation
QRhiq
bool debugMarkers = false
int currentFrameSlot = 0
bool inFrame = false
QRhiAdapterrequestedRhiAdapter = nullptr

Static Public Attributes

static const int SUPPORTED_STAGES = 5
Static Public Attributes inherited from QRhiImplementation
static const int MAX_SHADER_CACHE_ENTRIES = 128

Detailed Description

Definition at line 380 of file qrhimetal_p.h.

Constructor & Destructor Documentation

◆ QRhiMetal()

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

Definition at line 534 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 554 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 3956 of file qrhimetal.mm.

References QMetalCommandBuffer::ComputePass, 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 3075 of file qrhimetal.mm.

◆ beginFrame()

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

Implements QRhiImplementation.

Definition at line 3092 of file qrhimetal.mm.

References currentSwapChain, QMetalSwapChainRenderTarget::d, d, QMetalSwapChain::ds, executeDeferredReleases(), finishActiveReadbacks(), QMetalRenderTargetData::ColorAtt::needsDrawableForResolveTex, QMetalRenderTargetData::ColorAtt::needsDrawableForTex, QMetalSwapChain::rtWrapper, and QMetalSwapChain::samples.

Here is the call graph for this function:

◆ beginOffscreenFrame()

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

Implements QRhiImplementation.

Definition at line 3249 of file qrhimetal.mm.

References d, executeDeferredReleases(), and finishActiveReadbacks().

Here is the call graph for this function:

◆ beginPass()

◆ buildIndirect()

◆ clipSpaceCorrMatrix()

QMatrix4x4 QRhiMetal::clipSpaceCorrMatrix ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 830 of file qrhimetal.mm.

◆ commitIndirectCommandBuffer()

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

Reimplemented from QRhiImplementation.

Definition at line 4274 of file qrhimetal.mm.

◆ create()

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

Implements QRhiImplementation.

Definition at line 610 of file qrhimetal.mm.

References d, and importedDevice.

◆ createBuffer()

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

Implements QRhiImplementation.

Definition at line 805 of file qrhimetal.mm.

◆ createComputePipeline()

QRhiComputePipeline * QRhiMetal::createComputePipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1241 of file qrhimetal.mm.

◆ createGraphicsPipeline()

QRhiGraphicsPipeline * QRhiMetal::createGraphicsPipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1236 of file qrhimetal.mm.

◆ createIndirectCommandBuffer()

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

Reimplemented from QRhiImplementation.

Definition at line 4268 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 1204 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 1218 of file qrhimetal.mm.

◆ createShaderResourceBindings()

QRhiShaderResourceBindings * QRhiMetal::createShaderResourceBindings ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1246 of file qrhimetal.mm.

◆ createShadingRateMap()

QRhiShadingRateMap * QRhiMetal::createShadingRateMap ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1225 of file qrhimetal.mm.

◆ createSwapChain()

QRhiSwapChain * QRhiMetal::createSwapChain ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 800 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 1211 of file qrhimetal.mm.

◆ createTextureRenderTarget()

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

Implements QRhiImplementation.

Definition at line 1230 of file qrhimetal.mm.

◆ debugMarkBegin()

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

Implements QRhiImplementation.

Definition at line 3035 of file qrhimetal.mm.

◆ debugMarkEnd()

void QRhiMetal::debugMarkEnd ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 3048 of file qrhimetal.mm.

◆ debugMarkMsg()

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

Implements QRhiImplementation.

Definition at line 3060 of file qrhimetal.mm.

◆ destroy()

void QRhiMetal::destroy ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 725 of file qrhimetal.mm.

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

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 4010 of file qrhimetal.mm.

References QMetalCommandBuffer::ComputePass, QMetalCommandBuffer::currentComputePipeline, executeBufferHostWritesForCurrentFrame(), 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 2612 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 2641 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 2999 of file qrhimetal.mm.

References QMetalCommandBuffer::currentIndexBuffer, executeBufferHostWritesForCurrentFrame(), 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 4052 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 2972 of file qrhimetal.mm.

References executeBufferHostWritesForCurrentFrame(), 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 4033 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 1043 of file qrhimetal.mm.

◆ endComputePass()

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

Implements QRhiImplementation.

Definition at line 3971 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 3080 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 3273 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 3941 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 3519 of file qrhimetal.mm.

References QRhiResourceUpdateBatchPrivate::activeBufferOpCount, QRhiResourceUpdateBatchPrivate::activeTextureOpCount, QRhiResourceUpdateBatchPrivate::TextureOp::Copy, currentSwapChain, QMetalBuffer::d, QMetalSwapChain::d, QMetalSwapChainRenderTarget::d, QMetalTexture::d, d, QRhiResourceUpdateBatchPrivate::BufferOp::data, QRhiResourceUpdateBatchPrivate::TextureOp::dst, QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate, executeBufferHostWritesForCurrentFrame(), QRhiResourceUpdateBatchPrivate::free(), QRhiResourceUpdateBatchPrivate::TextureOp::GenMips, QRhiResourceUpdateBatchPrivate::get(), QMTL_FRAMES_IN_FLIGHT, 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()

void QRhiMetal::enqueueShaderResourceBindings ( QMetalShaderResourceBindings * srbD,
QMetalCommandBuffer * cbD,
int dynamicOffsetCount,
const QRhiCommandBuffer::DynamicOffset * dynamicOffsets,
bool offsetOnlyChange,
const QShader::NativeResourceBindingMap * nativeResourceBindingMaps[SUPPORTED_STAGES],
const QMetalShader * shaders[SUPPORTED_STAGES] )

◆ enqueueSubresUpload()

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

Definition at line 3383 of file qrhimetal.mm.

◆ executeBufferHostWritesForCurrentFrame()

void QRhiMetal::executeBufferHostWritesForCurrentFrame ( QMetalBuffer * bufD)

Definition at line 3744 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 3721 of file qrhimetal.mm.

References QMetalBuffer::d.

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

Here is the caller graph for this function:

◆ executeDeferredReleases()

void QRhiMetal::executeDeferredReleases ( bool forced = false)

Definition at line 4638 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 2276 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 3292 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 4685 of file qrhimetal.mm.

References d.

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 2692 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 2294 of file qrhimetal.mm.

References 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 825 of file qrhimetal.mm.

◆ isDeviceLost()

bool QRhiMetal::isDeviceLost ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 1074 of file qrhimetal.mm.

◆ isFeatureSupported()

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

Implements QRhiImplementation.

Definition at line 874 of file qrhimetal.mm.

◆ isTextureFormatSupported()

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

Implements QRhiImplementation.

Definition at line 841 of file qrhimetal.mm.

◆ isYUpInFramebuffer()

bool QRhiMetal::isYUpInFramebuffer ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 815 of file qrhimetal.mm.

◆ isYUpInNDC()

bool QRhiMetal::isYUpInNDC ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 820 of file qrhimetal.mm.

◆ lastCompletedGpuTime()

double QRhiMetal::lastCompletedGpuTime ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 3086 of file qrhimetal.mm.

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

◆ makeThreadLocalNativeContextCurrent()

bool QRhiMetal::makeThreadLocalNativeContextCurrent ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1055 of file qrhimetal.mm.

◆ nativeHandles() [1/2]

const QRhiNativeHandles * QRhiMetal::nativeHandles ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1038 of file qrhimetal.mm.

◆ nativeHandles() [2/2]

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

Implements QRhiImplementation.

Definition at line 3070 of file qrhimetal.mm.

◆ pipelineCacheData()

QByteArray QRhiMetal::pipelineCacheData ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1089 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 2771 of file qrhimetal.mm.

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

Here is the call graph for this function:

◆ prepareIcbKernels()

bool QRhiMetal::prepareIcbKernels ( )

Definition at line 2712 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 565 of file qrhimetal.mm.

◆ releaseCachedResources()

void QRhiMetal::releaseCachedResources ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1066 of file qrhimetal.mm.

References d.

◆ resourceLimit()

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

Implements QRhiImplementation.

Definition at line 996 of file qrhimetal.mm.

References QMTL_FRAMES_IN_FLIGHT.

◆ resourceUpdate()

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

Implements QRhiImplementation.

Definition at line 3749 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 2118 of file qrhimetal.mm.

References Bounded, and QMetalCommandBuffer::hasCustomScissorSet.

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

Here is the caller graph for this function:

◆ setGraphicsPipeline()

void QRhiMetal::setGraphicsPipeline ( QRhiCommandBuffer * cb,
QRhiGraphicsPipeline * ps )
overridevirtual

◆ setPipelineCacheData()

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

Implements QRhiImplementation.

Definition at line 1142 of file qrhimetal.mm.

References d, and QMetalPipelineCacheDataHeader::driver.

◆ setQueueSubmitParams()

void QRhiMetal::setQueueSubmitParams ( QRhiNativeHandles * params)
overridevirtual

Implements QRhiImplementation.

Definition at line 1061 of file qrhimetal.mm.

◆ setScissor()

◆ setShaderResources()

◆ setShadingRate()

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

Implements QRhiImplementation.

Definition at line 2235 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 2144 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 1048 of file qrhimetal.mm.

◆ subresUploadByteSize()

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

Definition at line 3373 of file qrhimetal.mm.

◆ supportedSampleCounts()

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

Implements QRhiImplementation.

◆ supportedShadingRates()

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

Implements QRhiImplementation.

Definition at line 794 of file qrhimetal.mm.

◆ tessellatedDraw()

void QRhiMetal::tessellatedDraw ( const TessDrawArgs & args)

◆ ubufAlignment()

int QRhiMetal::ubufAlignment ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 810 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 7863 of file qrhimetal.mm.

Member Data Documentation

◆ baseVertexAndInstance

bool QRhiMetal::baseVertexAndInstance = true

Definition at line 597 of file qrhimetal_p.h.

◆ [struct]

struct { ... } QRhiMetal::caps

◆ currentSwapChain

QMetalSwapChain* QRhiMetal::currentSwapChain = nullptr

Definition at line 588 of file qrhimetal_p.h.

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

◆ d

◆ depthClamp

bool QRhiMetal::depthClamp = true

Definition at line 604 of file qrhimetal_p.h.

◆ driverInfoStruct

QRhiDriverInfo QRhiMetal::driverInfoStruct

Definition at line 591 of file qrhimetal_p.h.

◆ importedCmdQueue

bool QRhiMetal::importedCmdQueue = false

Definition at line 587 of file qrhimetal_p.h.

Referenced by QRhiMetal().

◆ importedDevice

bool QRhiMetal::importedDevice = false

Definition at line 586 of file qrhimetal_p.h.

Referenced by QRhiMetal(), and create().

◆ indirectCommandBuffers

bool QRhiMetal::indirectCommandBuffers = false

Definition at line 602 of file qrhimetal_p.h.

◆ isAppleGPU

bool QRhiMetal::isAppleGPU = false

Definition at line 599 of file qrhimetal_p.h.

◆ maxTextureSize

int QRhiMetal::maxTextureSize = 4096

Definition at line 596 of file qrhimetal_p.h.

◆ maxThreadGroupSize

int QRhiMetal::maxThreadGroupSize = 512

Definition at line 600 of file qrhimetal_p.h.

◆ multiView

bool QRhiMetal::multiView = false

Definition at line 601 of file qrhimetal_p.h.

◆ nativeHandlesStruct

QRhiMetalNativeHandles QRhiMetal::nativeHandlesStruct

Definition at line 590 of file qrhimetal_p.h.

◆ osMajor

quint32 QRhiMetal::osMajor = 0

Definition at line 592 of file qrhimetal_p.h.

◆ osMinor

quint32 QRhiMetal::osMinor = 0

Definition at line 593 of file qrhimetal_p.h.

◆ rhiFlags

QRhi::Flags QRhiMetal::rhiFlags

Definition at line 585 of file qrhimetal_p.h.

◆ shadingRateMap

bool QRhiMetal::shadingRateMap = false

Definition at line 603 of file qrhimetal_p.h.

◆ SUPPORTED_STAGES

const int QRhiMetal::SUPPORTED_STAGES = 5
static

Definition at line 546 of file qrhimetal_p.h.

Referenced by enqueueShaderResourceBindings(), and setShaderResources().

◆ supportedSampleCounts

QVector< int > QRhiMetal::supportedSampleCounts

Definition at line 598 of file qrhimetal_p.h.

◆ swapchains

QSet<QMetalSwapChain *> QRhiMetal::swapchains

Definition at line 589 of file qrhimetal_p.h.


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