Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QRhiMetalData Struct Reference
+ Collaboration diagram for QRhiMetalData:

Classes

struct  BufferReadback
 
struct  DeferredReleaseEntry
 
struct  OffscreenFrame
 
struct  TextureReadback
 

Public Member Functions

 QRhiMetalData (QRhiMetal *rhi)
 
 API_AVAILABLE (macosx(11.0), ios(14.0)) id< MTLBinaryArchive > binArch
 
MTLRenderPassDescriptor * createDefaultRenderPass (bool hasDepthStencil, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, int colorAttCount)
 
id< MTLLibrary > createMetalLib (const QShader &shader, QShader::Variant shaderVariant, QString *error, QByteArray *entryPoint, QShaderKey *activeKey)
 
id< MTLFunction > createMSLShaderFunction (id< MTLLibrary > lib, const QByteArray &entryPoint)
 
bool setupBinaryArchive (NSURL *sourceFileUrl=nil)
 
void addRenderPipelineToBinaryArchive (MTLRenderPipelineDescriptor *rpDesc)
 
void trySeedingRenderPipelineFromBinaryArchive (MTLRenderPipelineDescriptor *rpDesc)
 
void addComputePipelineToBinaryArchive (MTLComputePipelineDescriptor *cpDesc)
 
void trySeedingComputePipelineFromBinaryArchive (MTLComputePipelineDescriptor *cpDesc)
 

Public Attributes

QRhiMetalq
 
id< MTLDevice > dev = nil
 
id< MTLCommandQueue > cmdQueue = nil
 
bool binArchWasEmpty = false
 
QVector< DeferredReleaseEntryreleaseQueue
 
struct QRhiMetalData::OffscreenFrame ofr
 
QVarLengthArray< TextureReadback, 2 > activeTextureReadbacks
 
QVarLengthArray< BufferReadback, 2 > activeBufferReadbacks
 
MTLCaptureManager * captureMgr
 
id< MTLCaptureScope > captureScope = nil
 
QHash< QRhiShaderStage, QMetalShadershaderCache
 

Static Public Attributes

static const int TEXBUF_ALIGN = 256
 

Detailed Description

Definition at line 153 of file qrhimetal.mm.

Constructor & Destructor Documentation

◆ QRhiMetalData()

QRhiMetalData::QRhiMetalData ( QRhiMetal rhi)
inline

Definition at line 155 of file qrhimetal.mm.

Member Function Documentation

◆ addComputePipelineToBinaryArchive()

void QRhiMetalData::addComputePipelineToBinaryArchive ( MTLComputePipelineDescriptor *  cpDesc)

Definition at line 5900 of file qrhimetal.mm.

References canAddToBinaryArchive(), error, iOS, qPrintable, and qWarning.

Referenced by QMetalGraphicsPipelineData::Tessellation::tescCompPipeline(), and QMetalGraphicsPipelineData::Tessellation::vsCompPipeline().

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

◆ addRenderPipelineToBinaryArchive()

void QRhiMetalData::addRenderPipelineToBinaryArchive ( MTLRenderPipelineDescriptor *  rpDesc)

Definition at line 4914 of file qrhimetal.mm.

References canAddToBinaryArchive(), error, iOS, qPrintable, and qWarning.

Referenced by QMetalGraphicsPipelineData::Tessellation::teseFragRenderPipeline().

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

◆ API_AVAILABLE()

QRhiMetalData::API_AVAILABLE ( macosx(11.0)  ,
ios(14.0)   
)

◆ createDefaultRenderPass()

MTLRenderPassDescriptor * QRhiMetalData::createDefaultRenderPass ( bool  hasDepthStencil,
const QColor colorClearValue,
const QRhiDepthStencilClearValue depthStencilClearValue,
int  colorAttCount 
)

Definition at line 2510 of file qrhimetal.mm.

References QColor::alphaF(), QColor::blueF(), QRhiDepthStencilClearValue::depthClearValue(), QColor::greenF(), i, QColor::redF(), and QRhiDepthStencilClearValue::stencilClearValue().

Referenced by QRhiMetal::beginPass().

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

◆ createMetalLib()

id< MTLLibrary > QRhiMetalData::createMetalLib ( const QShader shader,
QShader::Variant  shaderVariant,
QString error,
QByteArray entryPoint,
QShaderKey activeKey 
)

Definition at line 4654 of file qrhimetal.mm.

References QByteArray::constData(), dev, QShaderCode::entryPoint(), error, init(), iOS, QByteArray::isEmpty(), QShader::MetalLibShader, QShader::MslShader, qPrintable, qWarning, release(), QShaderCode::shader(), QByteArray::size(), and toMetalLanguageVersion().

+ Here is the call graph for this function:

◆ createMSLShaderFunction()

id< MTLFunction > QRhiMetalData::createMSLShaderFunction ( id< MTLLibrary >  lib,
const QByteArray entryPoint 
)

Definition at line 4733 of file qrhimetal.mm.

References QByteArray::constData().

+ Here is the call graph for this function:

◆ setupBinaryArchive()

bool QRhiMetalData::setupBinaryArchive ( NSURL *  sourceFileUrl = nil)

Definition at line 499 of file qrhimetal.mm.

References binArchWasEmpty, dev, error, iOS, qPrintable, qWarning, and release().

Referenced by QRhiMetal::create(), and QRhiMetal::setPipelineCacheData().

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

◆ trySeedingComputePipelineFromBinaryArchive()

void QRhiMetalData::trySeedingComputePipelineFromBinaryArchive ( MTLComputePipelineDescriptor *  cpDesc)

Definition at line 5890 of file qrhimetal.mm.

References iOS.

Referenced by QMetalGraphicsPipelineData::Tessellation::tescCompPipeline(), and QMetalGraphicsPipelineData::Tessellation::vsCompPipeline().

+ Here is the caller graph for this function:

◆ trySeedingRenderPipelineFromBinaryArchive()

void QRhiMetalData::trySeedingRenderPipelineFromBinaryArchive ( MTLRenderPipelineDescriptor *  rpDesc)

Definition at line 4881 of file qrhimetal.mm.

References iOS.

Referenced by QMetalGraphicsPipelineData::Tessellation::teseFragRenderPipeline().

+ Here is the caller graph for this function:

Member Data Documentation

◆ activeBufferReadbacks

QVarLengthArray<BufferReadback, 2> QRhiMetalData::activeBufferReadbacks

◆ activeTextureReadbacks

QVarLengthArray<TextureReadback, 2> QRhiMetalData::activeTextureReadbacks

Definition at line 235 of file qrhimetal.mm.

Referenced by QRhiMetal::finishActiveReadbacks().

◆ binArchWasEmpty

bool QRhiMetalData::binArchWasEmpty = false

Definition at line 161 of file qrhimetal.mm.

Referenced by setupBinaryArchive().

◆ captureMgr

MTLCaptureManager* QRhiMetalData::captureMgr

Definition at line 248 of file qrhimetal.mm.

Referenced by QRhiMetal::create().

◆ captureScope

id<MTLCaptureScope> QRhiMetalData::captureScope = nil

◆ cmdQueue

id<MTLCommandQueue> QRhiMetalData::cmdQueue = nil

◆ dev

◆ ofr

◆ q

QRhiMetal* QRhiMetalData::q

Definition at line 157 of file qrhimetal.mm.

◆ releaseQueue

QVector<DeferredReleaseEntry> QRhiMetalData::releaseQueue

Definition at line 217 of file qrhimetal.mm.

Referenced by QRhiMetal::executeDeferredReleases().

◆ shaderCache

QHash<QRhiShaderStage, QMetalShader> QRhiMetalData::shaderCache

Definition at line 253 of file qrhimetal.mm.

Referenced by QRhiMetal::destroy(), and QRhiMetal::releaseCachedResources().

◆ TEXBUF_ALIGN

const int QRhiMetalData::TEXBUF_ALIGN = 256
static

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