Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
 
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 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 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
 
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
 
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 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 enqueueShaderResourceBindings (QMetalShaderResourceBindings *srbD, QMetalCommandBuffer *cbD, int dynamicOffsetCount, const QRhiCommandBuffer::DynamicOffset *dynamicOffsets, bool offsetOnlyChange, const QShader::NativeResourceBindingMap *nativeResourceBindingMaps[SUPPORTED_STAGES])
 
void tessellatedDraw (const TessDrawArgs &args)
 
void adjustForMultiViewDraw (quint32 *instanceCount, QRhiCommandBuffer *cb)
 
- Public Member Functions inherited from QRhiImplementation
virtual ~QRhiImplementation ()
 
void prepareForCreate (QRhi *rhi, QRhi::Implementation impl, QRhi::Flags flags)
 
bool isCompressedFormat (QRhiTexture::Format format) const
 
void compressedFormatInfo (QRhiTexture::Format format, const QSize &size, quint32 *bpl, quint32 *byteSize, QSize *blockDim) const
 
void 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)
 
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
 

Static Public Member Functions

static bool probe (QRhiMetalInitParams *params)
 
static QRhiSwapChainProxyData updateSwapChainProxyData (QWindow *window)
 
- Static Public Member Functions inherited from QRhiImplementation
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 
 
caps 
 
QRhiMetalDatad = nullptr
 
- Public Attributes inherited from QRhiImplementation
QRhiq
 
bool debugMarkers = false
 
int currentFrameSlot = 0
 
bool inFrame = false
 

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 325 of file qrhimetal_p.h.

Constructor & Destructor Documentation

◆ QRhiMetal()

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

◆ ~QRhiMetal()

QRhiMetal::~QRhiMetal ( )

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

References QMetalCommandBufferData::cb, cb, QMetalCommandBuffer::ComputePass, QMetalCommandBufferData::currentComputePassEncoder, QMetalCommandBuffer::d, enqueueResourceUpdates(), QMetalCommandBuffer::NoPass, Q_ASSERT, QRHI_RES, 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 2324 of file qrhimetal.mm.

References cb, and Q_UNUSED.

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

References cb, QRhiImplementation::currentFrameSlot, d, executeDeferredReleases(), finishActiveReadbacks(), QRhi::FrameOpSuccess, QRhiMetalData::newCommandBuffer(), QRhiMetalData::ofr, Q_UNUSED, QMTL_FRAMES_IN_FLIGHT, and swapchains.

+ Here is the call graph for this function:

◆ beginPass()

◆ clipSpaceCorrMatrix()

QMatrix4x4 QRhiMetal::clipSpaceCorrMatrix ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 724 of file qrhimetal.mm.

◆ create()

◆ createBuffer()

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

Implements QRhiImplementation.

Definition at line 699 of file qrhimetal.mm.

◆ createComputePipeline()

QRhiComputePipeline * QRhiMetal::createComputePipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1105 of file qrhimetal.mm.

◆ createGraphicsPipeline()

QRhiGraphicsPipeline * QRhiMetal::createGraphicsPipeline ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1100 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 1073 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 1087 of file qrhimetal.mm.

◆ createShaderResourceBindings()

QRhiShaderResourceBindings * QRhiMetal::createShaderResourceBindings ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 1110 of file qrhimetal.mm.

◆ createSwapChain()

QRhiSwapChain * QRhiMetal::createSwapChain ( )
overridevirtual

Implements QRhiImplementation.

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

◆ createTextureRenderTarget()

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

Implements QRhiImplementation.

Definition at line 1094 of file qrhimetal.mm.

◆ debugMarkBegin()

◆ debugMarkEnd()

◆ debugMarkMsg()

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

Implements QRhiImplementation.

Definition at line 2309 of file qrhimetal.mm.

References cb, QByteArray::constData(), QMetalCommandBufferData::currentRenderPassEncoder, QMetalCommandBuffer::d, QRhiImplementation::debugMarkers, QMetalCommandBuffer::NoPass, QRHI_RES, and QMetalCommandBuffer::recordingPass.

+ Here is the call graph for this function:

◆ destroy()

void QRhiMetal::destroy ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 663 of file qrhimetal.mm.

References QRhiMetalData::captureScope, QHash< Key, T >::clear(), QRhiMetalData::cmdQueue, d, QRhiMetalData::dev, executeDeferredReleases(), finishActiveReadbacks(), importedCmdQueue, importedDevice, iOS, release(), and QRhiMetalData::shaderCache.

+ Here is the call graph for this function:

◆ dispatch()

◆ draw()

◆ drawIndexed()

◆ driverInfo()

QRhiDriverInfo QRhiMetal::driverInfo ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 913 of file qrhimetal.mm.

References driverInfoStruct.

◆ endComputePass()

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

Implements QRhiImplementation.

Definition at line 3085 of file qrhimetal.mm.

References cb, QMetalCommandBuffer::ComputePass, QMetalCommandBufferData::currentComputePassEncoder, QMetalCommandBuffer::d, enqueueResourceUpdates(), QMetalCommandBuffer::NoPass, Q_ASSERT, QRHI_RES, and QMetalCommandBuffer::recordingPass.

+ Here is the call graph for this function:

◆ endExternal()

void QRhiMetal::endExternal ( QRhiCommandBuffer * cb)
overridevirtual

Implements QRhiImplementation.

Definition at line 2329 of file qrhimetal.mm.

References cb, QRHI_RES, and QMetalCommandBuffer::resetPerPassCachedState().

+ Here is the call graph for this function:

◆ endFrame()

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

Implements QRhiImplementation.

Definition at line 2394 of file qrhimetal.mm.

References QRhiMetalData::captureScope, cb, QRhiImplementation::currentFrameSlot, currentSwapChain, d, QRhi::FrameOpSuccess, Q_ASSERT, QMTL_FRAMES_IN_FLIGHT, QRHI_RES, release(), and QRhi::SkipPresent.

+ Here is the call graph for this function:

◆ endOffscreenFrame()

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

Implements QRhiImplementation.

Definition at line 2471 of file qrhimetal.mm.

References cb, d, finishActiveReadbacks(), QRhi::FrameOpSuccess, QRhiMetalData::ofr, Q_ASSERT, and Q_UNUSED.

+ Here is the call graph for this function:

◆ endPass()

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

Implements QRhiImplementation.

Definition at line 3056 of file qrhimetal.mm.

References cb, QMetalCommandBufferData::currentRenderPassEncoder, QMetalCommandBuffer::currentTarget, QMetalCommandBuffer::d, enqueueResourceUpdates(), QMetalCommandBuffer::NoPass, Q_ASSERT, QRHI_RES, QMetalCommandBuffer::recordingPass, and QMetalCommandBuffer::RenderPass.

+ Here is the call graph for this function:

◆ enqueueResourceUpdates()

◆ enqueueShaderResourceBindings()

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

◆ enqueueSubresUpload()

◆ executeBufferHostWritesForCurrentFrame()

void QRhiMetal::executeBufferHostWritesForCurrentFrame ( QMetalBuffer * bufD)

Definition at line 2916 of file qrhimetal.mm.

References QRhiImplementation::currentFrameSlot, and executeBufferHostWritesForSlot().

Referenced by enqueueResourceUpdates(), 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 2893 of file qrhimetal.mm.

References contents, and d.

Referenced by executeBufferHostWritesForCurrentFrame().

+ Here is the caller graph for this function:

◆ executeDeferredReleases()

◆ finish()

QRhi::FrameOpResult QRhiMetal::finish ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 2490 of file qrhimetal.mm.

References cb, QRhiImplementation::currentFrameSlot, currentSwapChain, d, executeDeferredReleases(), finishActiveReadbacks(), QRhi::FrameOpSuccess, i, QRhiImplementation::inFrame, QRhiMetalData::newCommandBuffer(), QMetalCommandBuffer::NoPass, QRhiMetalData::ofr, Q_ASSERT, QMTL_FRAMES_IN_FLIGHT, and swapchains.

+ Here is the call graph for this function:

◆ finishActiveReadbacks()

void QRhiMetal::finishActiveReadbacks ( bool forced = false)

Definition at line 3189 of file qrhimetal.mm.

References QRhiMetalData::activeBufferReadbacks, QRhiMetalData::activeTextureReadbacks, contents, QRhiImplementation::currentFrameSlot, d, i, Q_ASSERT, release(), and void.

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

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

◆ isDeviceLost()

bool QRhiMetal::isDeviceLost ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 939 of file qrhimetal.mm.

◆ isFeatureSupported()

◆ isTextureFormatSupported()

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

◆ isYUpInFramebuffer()

bool QRhiMetal::isYUpInFramebuffer ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 709 of file qrhimetal.mm.

◆ isYUpInNDC()

bool QRhiMetal::isYUpInNDC ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 714 of file qrhimetal.mm.

◆ lastCompletedGpuTime()

double QRhiMetal::lastCompletedGpuTime ( QRhiCommandBuffer * cb)
overridevirtual

◆ makeThreadLocalNativeContextCurrent()

bool QRhiMetal::makeThreadLocalNativeContextCurrent ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 925 of file qrhimetal.mm.

◆ nativeHandles() [1/2]

const QRhiNativeHandles * QRhiMetal::nativeHandles ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 908 of file qrhimetal.mm.

References nativeHandlesStruct.

◆ nativeHandles() [2/2]

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

Implements QRhiImplementation.

Definition at line 2319 of file qrhimetal.mm.

References cb, and QRHI_RES.

◆ pipelineCacheData()

QByteArray QRhiMetal::pipelineCacheData ( )
overridevirtual

◆ probe()

bool QRhiMetal::probe ( QRhiMetalInitParams * params)
static

Definition at line 502 of file qrhimetal.mm.

References Q_UNUSED, and release().

Referenced by QRhi::probe().

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

◆ releaseCachedResources()

void QRhiMetal::releaseCachedResources ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 931 of file qrhimetal.mm.

References QHash< Key, T >::clear(), d, and QRhiMetalData::shaderCache.

+ Here is the call graph for this function:

◆ resourceLimit()

◆ resourceUpdate()

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

Implements QRhiImplementation.

Definition at line 2921 of file qrhimetal.mm.

References cb, enqueueResourceUpdates(), QMetalCommandBuffer::NoPass, Q_ASSERT, and QRHI_RES.

+ Here is the call graph for this function:

◆ setBlendConstants()

◆ setComputePipeline()

◆ setGraphicsPipeline()

◆ setPipelineCacheData()

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

Implements QRhiImplementation.

Definition at line 1009 of file qrhimetal.mm.

References QFileInfo::absoluteFilePath(), QByteArray::constData(), d, QRhiDriverInfo::deviceName, driverInfoStruct, QUrl::fromLocalFile(), header(), headerSize, iOS, QByteArray::length(), osMajor, osMinor, QRhiImplementation::pipelineCacheRhiId(), qCDebug, qMin(), QRhiMetalData::setupBinaryArchive(), and url.

+ Here is the call graph for this function:

◆ setScissor()

void QRhiMetal::setScissor ( QRhiCommandBuffer * cb,
const QRhiScissor & scissor )
overridevirtual

◆ setShaderResources()

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

Implements QRhiImplementation.

Definition at line 1514 of file qrhimetal.mm.

References QRhiShaderResourceBinding::BufferLoad, QRhiShaderResourceBinding::bufferLoad(), QRhiShaderResourceBinding::BufferLoadStore, QRhiShaderResourceBinding::BufferStore, cb, QMetalShaderResourceBindingsData::COMPUTE, QRhiShaderResourceBinding::ComputeStage, QRhiShaderResourceBinding::Data::TextureAndOrSamplerData::count, QMetalCommandBuffer::currentComputePipeline, QMetalCommandBuffer::currentComputeSrb, QRhiImplementation::currentFrameSlot, QMetalCommandBuffer::currentGraphicsPipeline, QMetalCommandBuffer::currentGraphicsSrb, QMetalCommandBuffer::currentResSlot, QMetalCommandBuffer::currentSrbGeneration, QMetalBuffer::d, enqueueShaderResourceBindings(), executeBufferHostWritesForCurrentFrame(), QMetalShaderResourceBindingsData::FRAGMENT, QRhiShaderResourceBinding::FragmentStage, i, QMetalShaderResourceBindings::BoundStorageBufferData::id, QRhiShaderResourceBinding::ImageLoad, QRhiShaderResourceBinding::ImageLoadStore, QRhiShaderResourceBinding::ImageStore, QShaderPrivate::MslBufferSizeBufferBinding, QMetalCommandBuffer::NoPass, Q_ASSERT, qMakePair(), qMax(), QRHI_RES, QMetalCommandBuffer::recordingPass, QRhiShaderResourceBinding::SampledTexture, QRhiShaderResourceBinding::Sampler, QMetalShaderResourceBindings::BoundResourceData::sbuf, QRhiImplementation::shaderResourceBindingData(), QRhiBufferData::size(), QRhiBuffer::StorageBuffer, SUPPORTED_STAGES, QMetalShaderResourceBindingsData::TESSCTRL, QRhiShaderResourceBinding::TessellationControlStage, QRhiShaderResourceBinding::TessellationEvaluationStage, QMetalShaderResourceBindingsData::TESSEVAL, QRhiShaderResourceBinding::Texture, QRhiShaderResourceBinding::UniformBuffer, QRhiBuffer::UniformBuffer, QMetalShaderResourceBindingsData::VERTEX, and QRhiShaderResourceBinding::VertexStage.

+ Here is the call graph for this function:

◆ setStencilRef()

◆ setVertexInput()

◆ setViewport()

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

Implements QRhiImplementation.

Definition at line 1846 of file qrhimetal.mm.

References cb, QMetalCommandBuffer::currentGraphicsPipeline, QMetalCommandBufferData::currentRenderPassEncoder, QMetalCommandBuffer::currentTarget, QMetalCommandBuffer::d, QRhiGraphicsPipeline::m_flags, QRhiRenderTarget::pixelSize(), Q_ASSERT, QRHI_RES, QMetalCommandBuffer::recordingPass, QMetalCommandBuffer::RenderPass, setViewport(), QRhiGraphicsPipeline::UsesScissor, and viewport().

Referenced by setViewport().

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

◆ statistics()

QRhiStats QRhiMetal::statistics ( )
overridevirtual

Implements QRhiImplementation.

Definition at line 918 of file qrhimetal.mm.

References QRhiStats::totalPipelineCreationTime, and QRhiImplementation::totalPipelineCreationTime().

+ Here is the call graph for this function:

◆ subresUploadByteSize()

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

Definition at line 2567 of file qrhimetal.mm.

References QRhiTextureSubresourceUploadDescription::data(), QRhiTextureSubresourceUploadDescription::image(), QImage::isNull(), QByteArray::size(), QImage::sizeInBytes(), and QRhiMetalData::TEXBUF_ALIGN.

+ Here is the call graph for this function:

◆ supportedSampleCounts()

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

Implements QRhiImplementation.

◆ tessellatedDraw()

void QRhiMetal::tessellatedDraw ( const TessDrawArgs & args)

Definition at line 1985 of file qrhimetal.mm.

References QMetalGraphicsPipelineData::ExtraBufferManager::acquireWorkBuffer(), args, QRhiBatchedBindings< T >::batches, caps, QMetalGraphicsPipelineData::Tessellation::compTesc, QMetalShaderResourceBindingsData::COMPUTE, QMetalGraphicsPipelineData::Tessellation::compVs, contents, QMetalCommandBufferData::currentComputePassEncoder, QMetalCommandBufferData::currentFirstVertexBinding, QMetalCommandBuffer::currentGraphicsPipeline, QMetalCommandBufferData::currentRenderPassEncoder, QMetalCommandBufferData::currentShaderResourceBindingState, QMetalCommandBufferData::currentVertexInputOffsets, QMetalCommandBufferData::currentVertexInputsBuffers, QMetalGraphicsPipeline::d, QMetalCommandBuffer::d, endTessellationComputeEncoding(), QShader::NativeShaderInfo::extraBufferBindings, QMetalGraphicsPipelineData::extraBufMgr, QMetalShaderResourceBindingsData::FRAGMENT, QMetalGraphicsPipelineData::ExtraBufferManager::HostVisible, i, QMetalGraphicsPipelineData::Tessellation::inControlPointCount, instanceCount, QMetalGraphicsPipeline::makeActiveForCurrentRenderPassEncoder(), QShaderPrivate::MslTessTescInputBufferBinding, QShaderPrivate::MslTessTescParamsBufferBinding, QShaderPrivate::MslTessTescPatchOutputBufferBinding, QShaderPrivate::MslTessTescTessLevelBufferBinding, QShaderPrivate::MslTessVertIndicesBufferBinding, QShaderPrivate::MslTessVertTescOutputBufferBinding, QMetalShader::nativeShaderInfo, QRhiMetal::TessDrawArgs::NonIndexed, QShader::NonIndexedVertexAsComputeShader, QMetalGraphicsPipelineData::Tessellation::outControlPointCount, QMetalGraphicsPipelineData::Tessellation::patchCountForDrawCall(), rebindShaderResources(), QMetalGraphicsPipelineData::Tessellation::tescCompOutputBufferSize(), QMetalGraphicsPipelineData::Tessellation::tescCompPatchOutputBufferSize(), QMetalGraphicsPipelineData::Tessellation::tescCompPipeline(), QMetalGraphicsPipelineData::tess, QMetalShaderResourceBindingsData::TESSCTRL, tessellationComputeEncoder(), QMetalShaderResourceBindingsData::TESSEVAL, QRhiMetal::TessDrawArgs::U16Indexed, QRhiMetal::TessDrawArgs::U32Indexed, QShader::UInt16IndexedVertexAsComputeShader, QShader::UInt32IndexedVertexAsComputeShader, QMetalShaderResourceBindingsData::VERTEX, QMetalGraphicsPipelineData::Tessellation::vsCompOutputBufferSize(), QMetalGraphicsPipelineData::Tessellation::vsCompPipeline(), and QMetalGraphicsPipelineData::Tessellation::vsCompVariantToIndex().

Referenced by draw(), and drawIndexed().

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

◆ ubufAlignment()

int QRhiMetal::ubufAlignment ( ) const
overridevirtual

Implements QRhiImplementation.

Definition at line 704 of file qrhimetal.mm.

◆ updateSwapChainProxyData()

QRhiSwapChainProxyData QRhiMetal::updateSwapChainProxyData ( QWindow * window)
static

Definition at line 6218 of file qrhimetal.mm.

References d, layerForWindow(), and window().

Referenced by QRhi::updateSwapChainProxyData().

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

Member Data Documentation

◆ baseVertexAndInstance

bool QRhiMetal::baseVertexAndInstance = true

Definition at line 498 of file qrhimetal_p.h.

◆ [struct]

◆ currentSwapChain

QMetalSwapChain* QRhiMetal::currentSwapChain = nullptr

Definition at line 489 of file qrhimetal_p.h.

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

◆ d

◆ driverInfoStruct

QRhiDriverInfo QRhiMetal::driverInfoStruct

Definition at line 492 of file qrhimetal_p.h.

Referenced by create(), driverInfo(), pipelineCacheData(), and setPipelineCacheData().

◆ importedCmdQueue

bool QRhiMetal::importedCmdQueue = false

Definition at line 488 of file qrhimetal_p.h.

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

◆ importedDevice

bool QRhiMetal::importedDevice = false

Definition at line 487 of file qrhimetal_p.h.

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

◆ isAppleGPU

bool QRhiMetal::isAppleGPU = false

Definition at line 500 of file qrhimetal_p.h.

◆ maxTextureSize

int QRhiMetal::maxTextureSize = 4096

Definition at line 497 of file qrhimetal_p.h.

◆ maxThreadGroupSize

int QRhiMetal::maxThreadGroupSize = 512

Definition at line 501 of file qrhimetal_p.h.

◆ multiView

bool QRhiMetal::multiView = false

Definition at line 502 of file qrhimetal_p.h.

◆ nativeHandlesStruct

QRhiMetalNativeHandles QRhiMetal::nativeHandlesStruct

Definition at line 491 of file qrhimetal_p.h.

Referenced by create(), and nativeHandles().

◆ osMajor

quint32 QRhiMetal::osMajor = 0

Definition at line 493 of file qrhimetal_p.h.

Referenced by create(), pipelineCacheData(), and setPipelineCacheData().

◆ osMinor

quint32 QRhiMetal::osMinor = 0

Definition at line 494 of file qrhimetal_p.h.

Referenced by create(), pipelineCacheData(), and setPipelineCacheData().

◆ rhiFlags

QRhi::Flags QRhiMetal::rhiFlags

Definition at line 486 of file qrhimetal_p.h.

Referenced by create(), and pipelineCacheData().

◆ SUPPORTED_STAGES

const int QRhiMetal::SUPPORTED_STAGES = 5
static

Definition at line 450 of file qrhimetal_p.h.

Referenced by enqueueShaderResourceBindings(), and setShaderResources().

◆ supportedSampleCounts

QVector< int > QRhiMetal::supportedSampleCounts

Definition at line 499 of file qrhimetal_p.h.

◆ swapchains

QSet<QMetalSwapChain *> QRhiMetal::swapchains

Definition at line 490 of file qrhimetal_p.h.

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


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