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>.
|
#include <qrhimetal_p.h>
Classes | |
struct | TessDrawArgs |
Static Public Member Functions | |
static bool | probe (QRhiMetalInitParams *params) |
static QRhiSwapChainProxyData | updateSwapChainProxyData (QWindow *window) |
Static Public Member Functions inherited from QRhiImplementation | |
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 | ||
int maxThreadGroupSize = 512 | ||
bool multiView = false | ||
} | caps | |
QRhiMetalData * | d = nullptr | |
Public Attributes inherited from QRhiImplementation | ||
QRhi * | q | |
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 |
Definition at line 325 of file qrhimetal_p.h.
QRhiMetal::QRhiMetal | ( | QRhiMetalInitParams * | params, |
QRhiMetalNativeHandles * | importDevice = nullptr ) |
Definition at line 471 of file qrhimetal.mm.
References QRhiMetalData::cmdQueue, d, QRhiMetalData::dev, importedCmdQueue, importedDevice, Q_UNUSED, and qWarning.
QRhiMetal::~QRhiMetal | ( | ) |
Definition at line 491 of file qrhimetal.mm.
References d.
void QRhiMetal::adjustForMultiViewDraw | ( | quint32 * | instanceCount, |
QRhiCommandBuffer * | cb ) |
Definition at line 2172 of file qrhimetal.mm.
References cb, contents, QMetalCommandBuffer::currentGraphicsPipeline, QMetalCommandBufferData::currentRenderPassEncoder, QMetalGraphicsPipeline::d, QMetalCommandBuffer::d, QShader::NativeShaderInfo::extraBufferBindings, QMetalGraphicsPipelineData::extraBufMgr, QMetalGraphicsPipelineData::ExtraBufferManager::HostVisible, instanceCount, QRhiGraphicsPipeline::m_multiViewCount, QShaderPrivate::MslMultiViewMaskBufferBinding, QMetalShader::nativeShaderInfo, QRHI_RES, qWarning, and QMetalGraphicsPipelineData::vs.
Referenced by draw(), and drawIndexed().
|
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2324 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2341 of file qrhimetal.mm.
References QRhiMetalData::captureScope, QRhiImplementation::currentFrameSlot, QMetalSwapChain::currentFrameSlot, currentSwapChain, d, executeDeferredReleases(), finishActiveReadbacks(), QRhi::FrameOpSuccess, QMetalRenderTargetData::ColorAtt::needsDrawableForResolveTex, QMetalRenderTargetData::ColorAtt::needsDrawableForTex, QRhiMetalData::newCommandBuffer(), Q_UNUSED, QRHI_RES, swapchains, and QMetalRenderTargetData::ColorAtt::tex.
|
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.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2928 of file qrhimetal.mm.
References QRhiTexture::arraySize(), QMetalCommandBufferData::cb, cb, QRhiMetalData::createDefaultRenderPass(), QRhiImplementation::currentFrameSlot, QMetalCommandBufferData::currentPassRpDesc, QMetalCommandBufferData::currentRenderPassEncoder, currentSwapChain, QMetalCommandBuffer::currentTarget, QMetalCommandBuffer::d, d, enqueueResourceUpdates(), i, it, QMetalTexture::lastActiveFrameSlot, QMetalCommandBuffer::NoPass, pool, Q_ASSERT, QRHI_RES, qWarning, QMetalCommandBuffer::recordingPass, QMetalCommandBuffer::RenderPass, QMetalCommandBuffer::resetPerPassState(), QRhiResource::resourceType(), QRhiResource::SwapChainRenderTarget, and QRhiResource::TextureRenderTarget.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 724 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 548 of file qrhimetal.mm.
References QString::asprintf(), caps, QRhiMetalData::captureMgr, QRhiMetalData::captureScope, QRhiMetalData::cmdQueue, QOperatingSystemVersionBase::current(), d, QRhiMetalData::dev, QRhiDriverInfo::deviceName, QRhiDriverInfo::deviceType, QRhiDriverInfo::DiscreteDevice, driverInfoStruct, QRhi::EnablePipelineCacheDataSave, QRhiDriverInfo::ExternalDevice, importedCmdQueue, importedDevice, QRhiDriverInfo::IntegratedDevice, iOS, QOperatingSystemVersionBase::majorVersion(), QOperatingSystemVersionBase::minorVersion(), nativeHandlesStruct, osMajor, osMinor, qCDebug, qPrintable, qWarning, rhiFlags, QRhiMetalData::setupBinaryArchive(), and QString::toUtf8().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 699 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 1105 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 1100 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 1073 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 1087 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 1110 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 694 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 1080 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 1094 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2284 of file qrhimetal.mm.
References QMetalCommandBufferData::cb, cb, QMetalCommandBufferData::currentRenderPassEncoder, QMetalCommandBuffer::d, QRhiImplementation::debugMarkers, QMetalCommandBuffer::NoPass, QRHI_RES, QMetalCommandBuffer::recordingPass, and str.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2297 of file qrhimetal.mm.
References QMetalCommandBufferData::cb, cb, QMetalCommandBufferData::currentRenderPassEncoder, QMetalCommandBuffer::d, QRhiImplementation::debugMarkers, QMetalCommandBuffer::NoPass, QRHI_RES, and QMetalCommandBuffer::recordingPass.
|
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.
|
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.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 3114 of file qrhimetal.mm.
References cb, QMetalCommandBuffer::ComputePass, QMetalCommandBufferData::currentComputePassEncoder, QMetalCommandBuffer::currentComputePipeline, QMetalCommandBuffer::d, Q_ASSERT, QRHI_RES, and QMetalCommandBuffer::recordingPass.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2205 of file qrhimetal.mm.
References adjustForMultiViewDraw(), caps, cb, QRhiMetal::TessDrawArgs::cbD, QMetalCommandBuffer::currentGraphicsPipeline, QMetalCommandBufferData::currentRenderPassEncoder, QMetalGraphicsPipeline::d, QMetalCommandBuffer::d, QRhiCommandBuffer::draw(), instanceCount, QRhiMetal::TessDrawArgs::NonIndexed, QMetalGraphicsPipelineData::primitiveType, Q_ASSERT, QRHI_RES, QMetalCommandBuffer::recordingPass, QMetalCommandBuffer::RenderPass, QMetalGraphicsPipelineData::tess, and tessellatedDraw().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2234 of file qrhimetal.mm.
References adjustForMultiViewDraw(), aligned(), QMetalBufferData::buf, caps, cb, QRhiMetal::TessDrawArgs::cbD, QRhiImplementation::currentFrameSlot, QMetalCommandBuffer::currentGraphicsPipeline, QMetalCommandBuffer::currentIndexBuffer, QMetalCommandBuffer::currentIndexFormat, QMetalCommandBuffer::currentIndexOffset, QMetalCommandBufferData::currentRenderPassEncoder, QMetalBuffer::d, QMetalGraphicsPipeline::d, QMetalCommandBuffer::d, QRhiCommandBuffer::IndexUInt16, instanceCount, QMetalGraphicsPipelineData::primitiveType, Q_ASSERT, QRHI_RES, QMetalCommandBuffer::recordingPass, QMetalCommandBuffer::RenderPass, QMetalGraphicsPipelineData::tess, tessellatedDraw(), QRhiMetal::TessDrawArgs::U16Indexed, and QRhiMetal::TessDrawArgs::U32Indexed.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 913 of file qrhimetal.mm.
References driverInfoStruct.
|
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.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2329 of file qrhimetal.mm.
References cb, QRHI_RES, and QMetalCommandBuffer::resetPerPassCachedState().
|
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.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2471 of file qrhimetal.mm.
References cb, d, finishActiveReadbacks(), QRhi::FrameOpSuccess, QRhiMetalData::ofr, Q_ASSERT, and Q_UNUSED.
|
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.
void QRhiMetal::enqueueResourceUpdates | ( | QRhiCommandBuffer * | cb, |
QRhiResourceUpdateBatch * | resourceUpdates ) |
Definition at line 2704 of file qrhimetal.mm.
References QRhiMetalData::activeBufferReadbacks, QRhiMetalData::BufferReadback::activeFrameSlot, QRhiResourceUpdateBatchPrivate::BufferOp::buf, QMetalCommandBufferData::cb, cb, contents, QRhiImplementation::currentFrameSlot, QMetalCommandBuffer::d, d, QRhiResourceUpdateBatchPrivate::BufferOp::data, QRhiImplementation::debugMarkers, QRhiBuffer::Dynamic, QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate, executeBufferHostWritesForCurrentFrame(), QRhiResourceUpdateBatchPrivate::get(), i, QRhiResourceUpdateBatchPrivate::BufferOp::offset, Q_ASSERT, QMTL_FRAMES_IN_FLIGHT, QRHI_RES, QRhiResourceUpdateBatchPrivate::BufferOp::Read, QRhiBufferData::size(), QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload, and QRhiResourceUpdateBatchPrivate::BufferOp::type.
Referenced by beginComputePass(), beginPass(), endComputePass(), endPass(), and resourceUpdate().
void QRhiMetal::enqueueShaderResourceBindings | ( | QMetalShaderResourceBindings * | srbD, |
QMetalCommandBuffer * | cbD, | ||
int | dynamicOffsetCount, | ||
const QRhiCommandBuffer::DynamicOffset * | dynamicOffsets, | ||
bool | offsetOnlyChange, | ||
const QShader::NativeResourceBindingMap * | nativeResourceBindingMaps[SUPPORTED_STAGES] ) |
Definition at line 1270 of file qrhimetal.mm.
References bindStageBuffers(), bindStageSamplers(), bindStageTextures(), Buffer, QRhiShaderResourceBinding::BufferLoad, QRhiShaderResourceBinding::BufferLoadStore, QRhiShaderResourceBinding::BufferStore, QMetalShaderResourceBindingsData::COMPUTE, QMetalCommandBuffer::ComputePass, QRhiImplementation::currentFrameSlot, QMetalCommandBufferData::currentShaderResourceBindingState, QMetalCommandBuffer::d, QMetalShaderResourceBindingsData::FRAGMENT, i, QRhiShaderResourceBinding::ImageLoad, QRhiShaderResourceBinding::ImageLoadStore, QRhiShaderResourceBinding::ImageStore, mapBinding(), QRHI_RES, QMetalCommandBuffer::recordingPass, QMetalCommandBuffer::RenderPass, QMetalShaderResourceBindingsData::res, QRhiShaderResourceBinding::SampledTexture, QRhiShaderResourceBinding::Sampler, Sampler, QRhiImplementation::shaderResourceBindingData(), SUPPORTED_STAGES, QMetalShaderResourceBindingsData::TESSCTRL, QMetalShaderResourceBindingsData::TESSEVAL, QRhiShaderResourceBinding::Texture, Texture, toRhiSrbStage(), QRhiShaderResourceBinding::UniformBuffer, and QMetalShaderResourceBindingsData::VERTEX.
Referenced by setShaderResources().
void QRhiMetal::enqueueSubresUpload | ( | QMetalTexture * | texD, |
void * | mp, | ||
void * | blitEncPtr, | ||
int | layer, | ||
int | level, | ||
const QRhiTextureSubresourceUploadDescription & | subresDesc, | ||
qsizetype * | curOfs ) |
Definition at line 2577 of file qrhimetal.mm.
References aligned(), QRhiImplementation::compressedFormatInfo(), QByteArray::constData(), QRhiImplementation::currentFrameSlot, QRhiTextureSubresourceUploadDescription::data(), QRhiTextureSubresourceUploadDescription::dataStride(), QRhiTextureSubresourceUploadDescription::destinationTopLeft(), QSize::height(), QRhiTextureSubresourceUploadDescription::image(), QRhiImplementation::isCompressedFormat(), QByteArray::isEmpty(), QSize::isEmpty(), QPoint::isNull(), Q_ASSERT, qMax(), qWarning, QByteArray::size(), QImage::sizeInBytes(), QRhiTextureSubresourceUploadDescription::sourceSize(), QRhiTextureSubresourceUploadDescription::sourceTopLeft(), QRhiMetalData::TEXBUF_ALIGN, QRhiImplementation::textureFormatInfo(), QRhiTexture::ThreeDimensional, QSize::width(), QPoint::x(), and QPoint::y().
void QRhiMetal::executeBufferHostWritesForCurrentFrame | ( | QMetalBuffer * | bufD | ) |
Definition at line 2916 of file qrhimetal.mm.
References QRhiImplementation::currentFrameSlot, and executeBufferHostWritesForSlot().
Referenced by enqueueResourceUpdates(), setShaderResources(), and setVertexInput().
void QRhiMetal::executeBufferHostWritesForSlot | ( | QMetalBuffer * | bufD, |
int | slot ) |
Definition at line 2893 of file qrhimetal.mm.
Referenced by executeBufferHostWritesForCurrentFrame().
Definition at line 3149 of file qrhimetal.mm.
References QRhiMetalData::DeferredReleaseEntry::Buffer, QRhiMetalData::DeferredReleaseEntry::ComputePipeline, QRhiMetalData::DeferredReleaseEntry::computePipeline, QRhiImplementation::currentFrameSlot, d, QRhiMetalData::DeferredReleaseEntry::GraphicsPipeline, QRhiMetalData::DeferredReleaseEntry::graphicsPipeline, i, QRhiMetalData::DeferredReleaseEntry::lastActiveFrameSlot, qrhimtl_releaseBuffer(), qrhimtl_releaseRenderBuffer(), qrhimtl_releaseSampler(), qrhimtl_releaseTexture(), release(), QRhiMetalData::releaseQueue, QRhiMetalData::DeferredReleaseEntry::RenderBuffer, QRhiMetalData::DeferredReleaseEntry::Sampler, QRhiMetalData::DeferredReleaseEntry::StagingBuffer, QRhiMetalData::DeferredReleaseEntry::stagingBuffer, QRhiMetalData::DeferredReleaseEntry::Texture, and QRhiMetalData::DeferredReleaseEntry::type.
Referenced by beginFrame(), beginOffscreenFrame(), destroy(), and 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.
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 719 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 939 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 771 of file qrhimetal.mm.
References QRhi::BaseInstance, QRhi::BaseVertex, caps, QRhi::Compute, QRhi::CustomInstanceStepRate, QRhi::DebugMarkers, QRhi::ElementIndexUint, QRhi::GeometryShader, QRhi::HalfAttributes, QRhi::ImageDataStride, QRhi::Instancing, QRhi::IntAttributes, iOS, QRhi::MultisampleRenderBuffer, QRhi::MultisampleTexture, QRhi::MultiView, QRhi::NonDynamicUniformBuffers, QRhi::NonFillPolygonMode, QRhi::NonFourAlignedEffectiveIndexBufferOffset, QRhi::NPOTTextureRepeat, QRhi::OneDimensionalTextureMipmaps, QRhi::OneDimensionalTextures, QRhi::PipelineCacheDataLoadSave, QRhi::PrimitiveRestart, QRhi::ReadBackAnyTextureFormat, QRhi::ReadBackNonBaseMipLevel, QRhi::ReadBackNonUniformBuffer, QRhi::RedOrAlpha8IsRed, QRhi::RenderBufferImport, QRhi::RenderTo3DTextureSlice, QRhi::RenderToNonBaseMipLevel, QRhi::RenderToOneDimensionalTexture, QRhi::ResolveDepthStencil, QRhi::ScreenSpaceDerivatives, QRhi::Tessellation, QRhi::TexelFetch, QRhi::TextureArrayRange, QRhi::TextureArrays, QRhi::TextureViewFormat, QRhi::ThreeDimensionalTextureMipmaps, QRhi::ThreeDimensionalTextures, QRhi::Timestamps, QRhi::TriangleFanTopology, QRhi::VertexShaderPointSize, and QRhi::WideLines.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 738 of file qrhimetal.mm.
References QRhiTexture::ASTC_12x12, QRhiTexture::ASTC_4x4, QRhiTexture::BC1, QRhiTexture::BC5, QRhiTexture::BC7, caps, QRhiTexture::ETC2_RGB8, QRhiTexture::ETC2_RGBA8, and Q_UNUSED.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 709 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 714 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2335 of file qrhimetal.mm.
References cb, QMetalCommandBuffer::d, QMetalCommandBufferData::lastGpuTime, and QRHI_RES.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 925 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 908 of file qrhimetal.mm.
References nativeHandlesStruct.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2319 of file qrhimetal.mm.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 954 of file qrhimetal.mm.
References QFileInfo::absoluteFilePath(), QByteArray::constData(), d, QRhiDriverInfo::deviceName, driverInfoStruct, QRhi::EnablePipelineCacheDataSave, error, QUrl::fromLocalFile(), header(), headerSize, iOS, QByteArray::length(), osMajor, osMinor, QRhiImplementation::pipelineCacheRhiId(), Q_STATIC_ASSERT, qCDebug, qMin(), qPrintable, QIODeviceBase::ReadOnly, rhiFlags, QByteArray::size(), and url.
|
static |
Definition at line 502 of file qrhimetal.mm.
References Q_UNUSED, and release().
Referenced by QRhi::probe().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 931 of file qrhimetal.mm.
References QHash< Key, T >::clear(), d, and QRhiMetalData::shaderCache.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 871 of file qrhimetal.mm.
References caps, QRhi::FramesInFlight, QRhi::MaxAsyncReadbackFrames, QRhi::MaxColorAttachments, QRhi::MaxThreadGroupsPerDimension, QRhi::MaxThreadGroupX, QRhi::MaxThreadGroupY, QRhi::MaxThreadGroupZ, QRhi::MaxThreadsPerThreadGroup, QRhi::MaxUniformBufferRange, QRhi::MaxVertexInputs, QRhi::MaxVertexOutputs, Q_FALLTHROUGH, QMTL_FRAMES_IN_FLIGHT, QRhi::TextureArraySizeMax, QRhi::TextureSizeMax, and QRhi::TextureSizeMin.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 2921 of file qrhimetal.mm.
References cb, enqueueResourceUpdates(), QMetalCommandBuffer::NoPass, Q_ASSERT, and QRHI_RES.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 1900 of file qrhimetal.mm.
References cb, QMetalCommandBufferData::currentRenderPassEncoder, QMetalCommandBuffer::d, Q_ASSERT, QRHI_RES, QMetalCommandBuffer::recordingPass, and QMetalCommandBuffer::RenderPass.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 3097 of file qrhimetal.mm.
References cb, QMetalCommandBuffer::ComputePass, QMetalCommandBufferData::currentComputePassEncoder, QMetalCommandBuffer::currentComputePipeline, QRhiImplementation::currentFrameSlot, QMetalCommandBuffer::currentGraphicsPipeline, QMetalCommandBuffer::currentPipelineGeneration, QMetalCommandBuffer::d, Q_ASSERT, QRHI_RES, and QMetalCommandBuffer::recordingPass.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 1484 of file qrhimetal.mm.
References cb, QMetalCommandBuffer::currentComputePipeline, QRhiImplementation::currentFrameSlot, QMetalCommandBuffer::currentGraphicsPipeline, QMetalCommandBuffer::currentPipelineGeneration, Q_ASSERT, QRHI_RES, QMetalCommandBuffer::recordingPass, and QMetalCommandBuffer::RenderPass.
|
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.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 1879 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, QRhiScissor::scissor(), and QRhiGraphicsPipeline::UsesScissor.
|
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.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 1909 of file qrhimetal.mm.
References cb, QMetalCommandBufferData::currentRenderPassEncoder, QMetalCommandBuffer::d, Q_ASSERT, QRHI_RES, QMetalCommandBuffer::recordingPass, and QMetalCommandBuffer::RenderPass.
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 1787 of file qrhimetal.mm.
References cb, QMetalCommandBufferData::currentFirstVertexBinding, QRhiImplementation::currentFrameSlot, QMetalCommandBuffer::currentGraphicsPipeline, QMetalCommandBuffer::currentGraphicsSrb, QMetalCommandBuffer::currentIndexBuffer, QMetalCommandBuffer::currentIndexFormat, QMetalCommandBuffer::currentIndexOffset, QMetalCommandBufferData::currentRenderPassEncoder, QMetalCommandBufferData::currentVertexInputOffsets, QMetalCommandBufferData::currentVertexInputsBuffers, QMetalCommandBuffer::d, executeBufferHostWritesForCurrentFrame(), i, Q_ASSERT, QRHI_RES, QMetalCommandBuffer::recordingPass, QMetalCommandBuffer::RenderPass, and QRhiGraphicsPipeline::shaderResourceBindings().
|
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 918 of file qrhimetal.mm.
References QRhiStats::totalPipelineCreationTime, and QRhiImplementation::totalPipelineCreationTime().
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.
|
overridevirtual |
Implements QRhiImplementation.
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().
|
overridevirtual |
Implements QRhiImplementation.
Definition at line 704 of file qrhimetal.mm.
|
static |
Definition at line 6218 of file qrhimetal.mm.
References d, layerForWindow(), and window().
Referenced by QRhi::updateSwapChainProxyData().
bool QRhiMetal::baseVertexAndInstance = true |
Definition at line 498 of file qrhimetal_p.h.
struct { ... } QRhiMetal::caps |
Referenced by create(), draw(), drawIndexed(), isFeatureSupported(), isTextureFormatSupported(), resourceLimit(), and tessellatedDraw().
QMetalSwapChain* QRhiMetal::currentSwapChain = nullptr |
Definition at line 489 of file qrhimetal_p.h.
Referenced by beginFrame(), beginPass(), endFrame(), and finish().
QRhiMetalData* QRhiMetal::d = nullptr |
Definition at line 505 of file qrhimetal_p.h.
Referenced by QRhiMetal(), ~QRhiMetal(), beginFrame(), beginOffscreenFrame(), beginPass(), create(), destroy(), endFrame(), endOffscreenFrame(), enqueueResourceUpdates(), executeBufferHostWritesForSlot(), executeDeferredReleases(), finish(), finishActiveReadbacks(), pipelineCacheData(), releaseCachedResources(), setPipelineCacheData(), and updateSwapChainProxyData().
QRhiDriverInfo QRhiMetal::driverInfoStruct |
Definition at line 492 of file qrhimetal_p.h.
Referenced by create(), driverInfo(), pipelineCacheData(), and setPipelineCacheData().
bool QRhiMetal::importedCmdQueue = false |
Definition at line 488 of file qrhimetal_p.h.
Referenced by QRhiMetal(), create(), and destroy().
bool QRhiMetal::importedDevice = false |
Definition at line 487 of file qrhimetal_p.h.
Referenced by QRhiMetal(), create(), and destroy().
bool QRhiMetal::isAppleGPU = false |
Definition at line 500 of file qrhimetal_p.h.
int QRhiMetal::maxTextureSize = 4096 |
Definition at line 497 of file qrhimetal_p.h.
int QRhiMetal::maxThreadGroupSize = 512 |
Definition at line 501 of file qrhimetal_p.h.
bool QRhiMetal::multiView = false |
Definition at line 502 of file qrhimetal_p.h.
QRhiMetalNativeHandles QRhiMetal::nativeHandlesStruct |
Definition at line 491 of file qrhimetal_p.h.
Referenced by create(), and nativeHandles().
quint32 QRhiMetal::osMajor = 0 |
Definition at line 493 of file qrhimetal_p.h.
Referenced by create(), pipelineCacheData(), and setPipelineCacheData().
quint32 QRhiMetal::osMinor = 0 |
Definition at line 494 of file qrhimetal_p.h.
Referenced by create(), pipelineCacheData(), and setPipelineCacheData().
QRhi::Flags QRhiMetal::rhiFlags |
Definition at line 486 of file qrhimetal_p.h.
Referenced by create(), and pipelineCacheData().
|
static |
Definition at line 450 of file qrhimetal_p.h.
Referenced by enqueueShaderResourceBindings(), and setShaderResources().
QVector< int > QRhiMetal::supportedSampleCounts |
Definition at line 499 of file qrhimetal_p.h.
QSet<QMetalSwapChain *> QRhiMetal::swapchains |
Definition at line 490 of file qrhimetal_p.h.
Referenced by beginFrame(), beginOffscreenFrame(), and finish().