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
QRhiGraphicsPipeline * createGraphicsPipeline () override
QRhiComputePipeline * createComputePipeline () override
QRhiShaderResourceBindings * createShaderResourceBindings () override
QRhiBuffer * createBuffer (QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size) override
QRhiRenderBuffer * createRenderBuffer (QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount, QRhiRenderBuffer::Flags flags, QRhiTexture::Format backingFormatHint) override
QRhiTexture * createTexture (QRhiTexture::Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, QRhiTexture::Flags flags) override
QRhiSampler * createSampler (QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter, QRhiSampler::Filter mipmapMode, QRhiSampler::AddressMode u, QRhiSampler::AddressMode v, QRhiSampler::AddressMode w) override
QRhiTextureRenderTarget * createTextureRenderTarget (const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags) override
QRhiShadingRateMap * createShadingRateMap () override
QRhiIndirectCommandBuffer * createIndirectCommandBuffer (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
QRhiSwapChain * createSwapChain () 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 setPushConstants (QRhiCommandBuffer *cb, quint32 offset, quint32 size, const void *data) 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 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 format, QRhiTexture::Flags flags) const override
bool isFeatureSupported (QRhi::Feature feature) const override
int resourceLimit (QRhi::ResourceLimit limit) const override
const QRhiNativeHandles * nativeHandles () 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 QSize outputSizeForTarget (QRhiRenderTarget *target)
Static Public Member Functions inherited from QRhiImplementation
static QRhiImplementation * newInstance (QRhi::Implementation impl, QRhiInitParams *params, QRhiNativeHandles *importDevice)
static const QRhiShaderResourceBinding::Data * shaderResourceBindingData (const QRhiShaderResourceBinding &binding)
static QRhiShaderResourceBinding::Data * shaderResourceBindingData (QRhiShaderResourceBinding &binding)
static bool sortedBindingLessThan (const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b)

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 { 
   int   maxTextureSize = 4096 
   bool   baseVertexAndInstance = true 
   QVector< int >   supportedSampleCounts 
   bool   isAppleGPU = false 
   bool   usePrivateStaticBuffers = false 
   int   maxThreadGroupSize = 512 
   bool   multiView = false 
   bool   indirectCommandBuffers = false 
   bool   shadingRateMap = false 
   bool   depthClamp = true 
} 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 387 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 4253 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 3266 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 3441 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 882 of file qrhimetal.mm.

◆ commitIndirectCommandBuffer()

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

Reimplemented from QRhiImplementation.

Definition at line 4571 of file qrhimetal.mm.

◆ create()

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

Implements QRhiImplementation.

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

◆ createComputePipeline()

QRhiComputePipeline * QRhiMetal::createComputePipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1301 of file qrhimetal.mm.

◆ createGraphicsPipeline()

QRhiGraphicsPipeline * QRhiMetal::createGraphicsPipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1296 of file qrhimetal.mm.

◆ createIndirectCommandBuffer()

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

Reimplemented from QRhiImplementation.

Definition at line 4565 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 1264 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 1278 of file qrhimetal.mm.

◆ createShaderResourceBindings()

QRhiShaderResourceBindings * QRhiMetal::createShaderResourceBindings ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1306 of file qrhimetal.mm.

◆ createShadingRateMap()

QRhiShadingRateMap * QRhiMetal::createShadingRateMap ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1285 of file qrhimetal.mm.

◆ createSwapChain()

QRhiSwapChain * QRhiMetal::createSwapChain ( )
overridevirtual

Implements QRhiImplementation.

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

◆ createTextureRenderTarget()

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

Implements QRhiImplementation.

Definition at line 1290 of file qrhimetal.mm.

◆ debugMarkBegin()

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

Implements QRhiImplementation.

Definition at line 3200 of file qrhimetal.mm.

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

◆ debugMarkEnd()

void QRhiMetal::debugMarkEnd ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

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

References QMetalCommandBuffer::recordingPass.

◆ destroy()

void QRhiMetal::destroy ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 775 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 4307 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 2779 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 2808 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 3164 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 4349 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 3137 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 4330 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 1103 of file qrhimetal.mm.

◆ endComputePass()

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

Implements QRhiImplementation.

Definition at line 4268 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 3271 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 3466 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 4238 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 3712 of file qrhimetal.mm.

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

◆ enqueueSubresUpload()

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

Definition at line 3576 of file qrhimetal.mm.

◆ executeBufferHostWritesForCurrentFrame()

void QRhiMetal::executeBufferHostWritesForCurrentFrame ( QMetalBuffer * bufD)

Definition at line 4039 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 4014 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 4937 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 2425 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 3485 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 4988 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 2859 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 2443 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 877 of file qrhimetal.mm.

◆ isDeviceLost()

bool QRhiMetal::isDeviceLost ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 1134 of file qrhimetal.mm.

◆ isFeatureSupported()

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

Implements QRhiImplementation.

Definition at line 926 of file qrhimetal.mm.

◆ isTextureFormatSupported()

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

Implements QRhiImplementation.

Definition at line 893 of file qrhimetal.mm.

◆ isYUpInFramebuffer()

bool QRhiMetal::isYUpInFramebuffer ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 867 of file qrhimetal.mm.

◆ isYUpInNDC()

bool QRhiMetal::isYUpInNDC ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 872 of file qrhimetal.mm.

◆ lastCompletedGpuTime()

double QRhiMetal::lastCompletedGpuTime ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 3277 of file qrhimetal.mm.

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

◆ makeThreadLocalNativeContextCurrent()

bool QRhiMetal::makeThreadLocalNativeContextCurrent ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1115 of file qrhimetal.mm.

◆ nativeHandles() [1/2]

const QRhiNativeHandles * QRhiMetal::nativeHandles ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1098 of file qrhimetal.mm.

◆ nativeHandles() [2/2]

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

Implements QRhiImplementation.

Definition at line 3261 of file qrhimetal.mm.

◆ outputSizeForTarget()

QSize QRhiMetal::outputSizeForTarget ( QRhiRenderTarget * target)
static

Definition at line 2210 of file qrhimetal.mm.

◆ pipelineCacheData()

QByteArray QRhiMetal::pipelineCacheData ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1149 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 2938 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 2879 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 1126 of file qrhimetal.mm.

References d.

◆ resourceLimit()

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

Implements QRhiImplementation.

Definition at line 1054 of file qrhimetal.mm.

References QMTL_FRAMES_IN_FLIGHT.

◆ resourceUpdate()

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

Implements QRhiImplementation.

Definition at line 4044 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 2233 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 1202 of file qrhimetal.mm.

References d, and QMetalPipelineCacheDataHeader::driver.

◆ setPushConstants()

◆ setQueueSubmitParams()

void QRhiMetal::setQueueSubmitParams ( QRhiNativeHandles * params)
overridevirtual

Implements QRhiImplementation.

Definition at line 1121 of file qrhimetal.mm.

◆ setScissor()

◆ setShaderResources()

◆ setShadingRate()

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

Implements QRhiImplementation.

Definition at line 2384 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 2259 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 1108 of file qrhimetal.mm.

◆ subresUploadByteSize()

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

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

◆ tessellatedDraw()

void QRhiMetal::tessellatedDraw ( const TessDrawArgs & args)

◆ ubufAlignment()

int QRhiMetal::ubufAlignment ( ) const
overridevirtual

Implements QRhiImplementation.

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

Member Data Documentation

◆ baseVertexAndInstance

bool QRhiMetal::baseVertexAndInstance = true

Definition at line 606 of file qrhimetal_p.h.

◆ [struct]

struct { ... } QRhiMetal::caps

◆ currentSwapChain

QMetalSwapChain* QRhiMetal::currentSwapChain = nullptr

Definition at line 597 of file qrhimetal_p.h.

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

◆ d

◆ depthClamp

bool QRhiMetal::depthClamp = true

Definition at line 620 of file qrhimetal_p.h.

◆ driverInfoStruct

QRhiDriverInfo QRhiMetal::driverInfoStruct

Definition at line 600 of file qrhimetal_p.h.

◆ importedCmdQueue

bool QRhiMetal::importedCmdQueue = false

Definition at line 596 of file qrhimetal_p.h.

Referenced by QRhiMetal().

◆ importedDevice

bool QRhiMetal::importedDevice = false

Definition at line 595 of file qrhimetal_p.h.

Referenced by QRhiMetal(), and create().

◆ indirectCommandBuffers

bool QRhiMetal::indirectCommandBuffers = false

Definition at line 618 of file qrhimetal_p.h.

◆ isAppleGPU

bool QRhiMetal::isAppleGPU = false

Definition at line 608 of file qrhimetal_p.h.

◆ maxTextureSize

int QRhiMetal::maxTextureSize = 4096

Definition at line 605 of file qrhimetal_p.h.

◆ maxThreadGroupSize

int QRhiMetal::maxThreadGroupSize = 512

Definition at line 616 of file qrhimetal_p.h.

◆ multiView

bool QRhiMetal::multiView = false

Definition at line 617 of file qrhimetal_p.h.

◆ nativeHandlesStruct

QRhiMetalNativeHandles QRhiMetal::nativeHandlesStruct

Definition at line 599 of file qrhimetal_p.h.

◆ osMajor

quint32 QRhiMetal::osMajor = 0

Definition at line 601 of file qrhimetal_p.h.

◆ osMinor

quint32 QRhiMetal::osMinor = 0

Definition at line 602 of file qrhimetal_p.h.

◆ rhiFlags

QRhi::Flags QRhiMetal::rhiFlags

Definition at line 594 of file qrhimetal_p.h.

◆ shadingRateMap

bool QRhiMetal::shadingRateMap = false

Definition at line 619 of file qrhimetal_p.h.

◆ SUPPORTED_STAGES

const int QRhiMetal::SUPPORTED_STAGES = 5
static

Definition at line 554 of file qrhimetal_p.h.

Referenced by enqueueShaderResourceBindings(), and setShaderResources().

◆ supportedSampleCounts

QVector< int > QRhiMetal::supportedSampleCounts

Definition at line 607 of file qrhimetal_p.h.

◆ swapchains

QSet<QMetalSwapChain *> QRhiMetal::swapchains

Definition at line 598 of file qrhimetal_p.h.

◆ usePrivateStaticBuffers

bool QRhiMetal::usePrivateStaticBuffers = false

Definition at line 615 of file qrhimetal_p.h.


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