![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qrhimetal_p.h>
Public Types | |
| enum | PassType { NoPass , RenderPass , ComputePass } |
| Public Types inherited from QRhiCommandBuffer | |
| enum | IndexFormat { IndexUInt16 , IndexUInt32 } |
| Specifies the index data type. More... | |
| enum | BeginPassFlag { ExternalContent = 0x01 , DoNotTrackResourcesForCompute = 0x02 } |
| Flag values for QRhi::beginPass(). More... | |
| using | DynamicOffset = std::pair<int, quint32> |
| Synonym for std::pair<int, quint32>. | |
| using | VertexInput = std::pair<QRhiBuffer *, quint32> |
| Synonym for std::pair<QRhiBuffer *, quint32>. | |
| Public Types inherited from QRhiResource | |
| enum | Type { Buffer , Texture , Sampler , RenderBuffer , RenderPassDescriptor , SwapChainRenderTarget , TextureRenderTarget , ShaderResourceBindings , GraphicsPipeline , SwapChain , ComputePipeline , CommandBuffer , ShadingRateMap , IndirectCommandBuffer } |
| Specifies type of the resource. More... | |
Public Member Functions | |
| QMetalCommandBuffer (QRhiImplementation *rhi) | |
| ~QMetalCommandBuffer () | |
| void | destroy () override |
| Releases (or requests deferred releasing of) the underlying native graphics resources. | |
| const QRhiNativeHandles * | nativeHandles () |
| void | resetState (double lastGpuTime=0) |
| void | resetPerPassState () |
| void | resetPerPassCachedState () |
| Public Member Functions inherited from QRhiCommandBuffer | |
| QRhiResource::Type | resourceType () const override |
| void | resourceUpdate (QRhiResourceUpdateBatch *resourceUpdates) |
| Sometimes committing resource updates is necessary or just more convenient without starting a render pass. | |
| void | beginPass (QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, QRhiResourceUpdateBatch *resourceUpdates=nullptr, BeginPassFlags flags={}) |
| Records starting a new render pass targeting the render target rt. | |
| void | endPass (QRhiResourceUpdateBatch *resourceUpdates=nullptr) |
| Records ending the current render pass. | |
| void | setGraphicsPipeline (QRhiGraphicsPipeline *ps) |
| Records setting a new graphics pipeline ps. | |
| void | setShaderResources (QRhiShaderResourceBindings *srb=nullptr, int dynamicOffsetCount=0, const DynamicOffset *dynamicOffsets=nullptr) |
| Records binding a set of shader resources, such as, uniform buffers or textures, that are made visible to one or more shader stages. | |
| void | setVertexInput (int startBinding, int bindingCount, const VertexInput *bindings, QRhiBuffer *indexBuf=nullptr, quint32 indexOffset=0, IndexFormat indexFormat=IndexUInt16) |
| Records vertex input bindings. | |
| void | setViewport (const QRhiViewport &viewport) |
| Records setting the active viewport rectangle specified in viewport. | |
| void | setScissor (const QRhiScissor &scissor) |
| Records setting the active scissor rectangle specified in scissor. | |
| void | setBlendConstants (const QColor &c) |
| Records setting the active blend constants to c. | |
| void | setStencilRef (quint32 refValue) |
| Records setting the active stencil reference value to refValue. | |
| void | setShadingRate (const QSize &coarsePixelSize) |
| Sets the shading rate for the following draw calls to coarsePixelSize. | |
| void | draw (quint32 vertexCount, quint32 instanceCount=1, quint32 firstVertex=0, quint32 firstInstance=0) |
| Records a non-indexed draw. | |
| void | drawIndexed (quint32 indexCount, quint32 instanceCount=1, quint32 firstIndex=0, qint32 vertexOffset=0, quint32 firstInstance=0) |
| Records an indexed draw. | |
| void | drawIndirect (QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride=sizeof(QRhiIndirectDrawCommand)) |
| Records a non-indexed, indirect draw. | |
| void | drawIndexedIndirect (QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, quint32 drawCount, quint32 stride=sizeof(QRhiIndexedIndirectDrawCommand)) |
| Records an indexed, indirect draw. | |
| void | drawIndirectCount (QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride=sizeof(QRhiIndirectDrawCommand)) |
| Records a non-indexed, indirect draw, with the draw count itself read from a buffer at execution time. | |
| void | drawIndexedIndirectCount (QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset, QRhiBuffer *countBuffer, quint32 countBufferOffset, quint32 maxDrawCount, quint32 stride=sizeof(QRhiIndexedIndirectDrawCommand)) |
| Indexed variant of drawIndirectCount(). | |
| void | buildIndirect (QRhiIndirectCommandBuffer *icb, const QRhiIndirectCommandBufferBuildInfo &info) |
| Records populating the indirect command buffer icb from the buffer and parameters described by info. | |
| void | executeIndirect (QRhiIndirectCommandBuffer *icb, quint32 firstCommand=0, quint32 commandCount=0xFFFFFFFFu) |
| Records executing the commands held by the indirect command buffer icb, starting at firstCommand and executing at most commandCount of them. | |
| void | debugMarkBegin (const QByteArray &name) |
| Records a named debug group on the command buffer with the specified name. | |
| void | debugMarkEnd () |
| Records the end of a debug group. | |
| void | debugMarkMsg (const QByteArray &msg) |
| Inserts a debug message msg into the command stream. | |
| void | beginComputePass (QRhiResourceUpdateBatch *resourceUpdates=nullptr, BeginPassFlags flags={}) |
| Records starting a new compute pass. | |
| void | endComputePass (QRhiResourceUpdateBatch *resourceUpdates=nullptr) |
| Records ending the current compute pass. | |
| void | setComputePipeline (QRhiComputePipeline *ps) |
| Records setting a new compute pipeline ps. | |
| void | dispatch (int x, int y, int z) |
| Records dispatching compute work items, with x, y, and z specifying the number of local workgroups in the corresponding dimension. | |
| void | dispatchIndirect (QRhiBuffer *indirectBuffer, quint32 indirectBufferOffset=0) |
| Records an indirect compute dispatch. | |
| const QRhiNativeHandles * | nativeHandles () |
| void | beginExternal () |
| To be called when the application before the application is about to enqueue commands to the current pass' command buffer by calling graphics API functions directly. | |
| void | endExternal () |
| To be called once the externally added commands are recorded to the command buffer or context. | |
| double | lastCompletedGpuTime () |
| Public Member Functions inherited from QRhiResource | |
| virtual | ~QRhiResource () |
| Destructor. | |
| void | deleteLater () |
| When called without a frame being recorded, this function is equivalent to deleting the object. | |
| QByteArray | name () const |
| void | setName (const QByteArray &name) |
| Sets a name for the object. | |
| quint64 | globalResourceId () const |
| QRhi * | rhi () const |
Additional Inherited Members | |
| Protected Member Functions inherited from QRhiCommandBuffer | |
| QRhiCommandBuffer (QRhiImplementation *rhi) | |
| Protected Member Functions inherited from QRhiResource | |
| QRhiResource (QRhiImplementation *rhi) | |
| Protected Attributes inherited from QRhiResource | |
| QRhiImplementation * | m_rhi = nullptr |
| quint64 | m_id |
| QByteArray | m_objectName |
Definition at line 296 of file qrhimetal_p.h.
| Enumerator | |
|---|---|
| NoPass | |
| RenderPass | |
| ComputePass | |
Definition at line 305 of file qrhimetal_p.h.
| QMetalCommandBuffer::QMetalCommandBuffer | ( | QRhiImplementation * | rhi | ) |
Definition at line 7708 of file qrhimetal.mm.
References QMetalCommandBuffer(), d, and resetState().
Referenced by QMetalCommandBuffer().
| QMetalCommandBuffer::~QMetalCommandBuffer | ( | ) |
|
overridevirtual |
Releases (or requests deferred releasing of) the underlying native graphics resources.
Safe to call multiple times, subsequent invocations will be a no-op then.
Once destroy() is called, the QRhiResource instance can be reused, by calling create() again. That will then result in creating new native graphics resources underneath.
The QRhiResource destructor also performs the same task, so calling this function is not necessary before deleting a QRhiResource.
Implements QRhiResource.
Definition at line 7721 of file qrhimetal.mm.
Referenced by ~QMetalCommandBuffer().
| const QRhiNativeHandles * QMetalCommandBuffer::nativeHandles | ( | ) |
Definition at line 7726 of file qrhimetal.mm.
| void QMetalCommandBuffer::resetPerPassCachedState | ( | ) |
Definition at line 7750 of file qrhimetal.mm.
References currentComputePipeline, currentComputeSrb, currentCullMode, currentDepthClipMode, QMetalCommandBufferData::currentFirstVertexBinding, currentFrontFaceWinding, currentGraphicsPipeline, currentGraphicsSrb, currentIndexBuffer, currentResSlot, currentTriangleFillMode, d, hasBlendConstantsSet, hasCustomScissorSet, and hasStencilRefSet.
Referenced by QRhiMetal::endExternal(), endTempComputeEncoding(), and resetPerPassState().
| void QMetalCommandBuffer::resetPerPassState | ( | ) |
Definition at line 7743 of file qrhimetal.mm.
References NoPass, recordingPass, and resetPerPassCachedState().
Referenced by QRhiMetal::beginComputePass(), QRhiMetal::beginPass(), and resetState().
| void QMetalCommandBuffer::resetState | ( | double | lastGpuTime = 0 | ) |
Definition at line 7733 of file qrhimetal.mm.
References d, QMetalCommandBufferData::lastGpuTime, and resetPerPassState().
Referenced by QMetalCommandBuffer().
| QColor QMetalCommandBuffer::currentBlendConstants |
Definition at line 335 of file qrhimetal_p.h.
| QMetalComputePipeline* QMetalCommandBuffer::currentComputePipeline |
Definition at line 317 of file qrhimetal_p.h.
Referenced by QRhiMetal::dispatch(), QRhiMetal::dispatchIndirect(), QMetalGraphicsPipeline::makeActiveForCurrentRenderPassEncoder(), resetPerPassCachedState(), QRhiMetal::setComputePipeline(), QRhiMetal::setGraphicsPipeline(), and QRhiMetal::setShaderResources().
| QMetalShaderResourceBindings* QMetalCommandBuffer::currentComputeSrb |
Definition at line 320 of file qrhimetal_p.h.
Referenced by resetPerPassCachedState(), and QRhiMetal::setShaderResources().
| int QMetalCommandBuffer::currentCullMode |
Definition at line 326 of file qrhimetal_p.h.
Referenced by QMetalGraphicsPipeline::makeActiveForCurrentRenderPassEncoder(), and resetPerPassCachedState().
| std::pair<float, float> QMetalCommandBuffer::currentDepthBiasValues |
Definition at line 330 of file qrhimetal_p.h.
| int QMetalCommandBuffer::currentDepthClipMode |
Definition at line 328 of file qrhimetal_p.h.
Referenced by QMetalGraphicsPipeline::makeActiveForCurrentRenderPassEncoder(), and resetPerPassCachedState().
| int QMetalCommandBuffer::currentFrontFaceWinding |
Definition at line 329 of file qrhimetal_p.h.
Referenced by QMetalGraphicsPipeline::makeActiveForCurrentRenderPassEncoder(), and resetPerPassCachedState().
| QMetalGraphicsPipeline* QMetalCommandBuffer::currentGraphicsPipeline |
Definition at line 316 of file qrhimetal_p.h.
Referenced by QRhiMetal::adjustForMultiViewDraw(), QRhiMetal::draw(), QRhiMetal::drawIndexed(), endTempComputeEncoding(), QRhiMetal::executeIndirect(), QRhiMetal::icbDraw(), QRhiMetal::icbUnavailableReason(), QMetalGraphicsPipeline::makeActiveForCurrentRenderPassEncoder(), qrhimtl_replayIcbOnCpu(), resetPerPassCachedState(), QRhiMetal::setComputePipeline(), QRhiMetal::setGraphicsPipeline(), QRhiMetal::setScissor(), QRhiMetal::setShaderResources(), QRhiMetal::setVertexInput(), QRhiMetal::setViewport(), and QRhiMetal::tessellatedDraw().
| QMetalShaderResourceBindings* QMetalCommandBuffer::currentGraphicsSrb |
Definition at line 319 of file qrhimetal_p.h.
Referenced by resetPerPassCachedState(), QRhiMetal::setShaderResources(), and QRhiMetal::setVertexInput().
| QMetalBuffer* QMetalCommandBuffer::currentIndexBuffer |
Definition at line 323 of file qrhimetal_p.h.
Referenced by QRhiMetal::drawIndexed(), QRhiMetal::drawIndexedIndirect(), QRhiMetal::drawIndexedIndirectCount(), QRhiMetal::executeIndirect(), QRhiMetal::icbDraw(), qrhimtl_replayIcbOnCpu(), resetPerPassCachedState(), and QRhiMetal::setVertexInput().
| QRhiCommandBuffer::IndexFormat QMetalCommandBuffer::currentIndexFormat |
Definition at line 325 of file qrhimetal_p.h.
| quint32 QMetalCommandBuffer::currentIndexOffset |
Definition at line 324 of file qrhimetal_p.h.
| uint QMetalCommandBuffer::currentPipelineGeneration |
Definition at line 318 of file qrhimetal_p.h.
| int QMetalCommandBuffer::currentResSlot |
Definition at line 322 of file qrhimetal_p.h.
Referenced by resetPerPassCachedState(), and QRhiMetal::setShaderResources().
| QRhiScissor QMetalCommandBuffer::currentScissor |
Definition at line 332 of file qrhimetal_p.h.
| uint QMetalCommandBuffer::currentSrbGeneration |
Definition at line 321 of file qrhimetal_p.h.
| quint32 QMetalCommandBuffer::currentStencilRef |
Definition at line 337 of file qrhimetal_p.h.
| QRhiRenderTarget* QMetalCommandBuffer::currentTarget |
Definition at line 313 of file qrhimetal_p.h.
| int QMetalCommandBuffer::currentTriangleFillMode |
Definition at line 327 of file qrhimetal_p.h.
Referenced by QMetalGraphicsPipeline::makeActiveForCurrentRenderPassEncoder(), and resetPerPassCachedState().
| QRhiViewport QMetalCommandBuffer::currentViewport |
Definition at line 333 of file qrhimetal_p.h.
| QMetalCommandBufferData* QMetalCommandBuffer::d = nullptr |
Definition at line 302 of file qrhimetal_p.h.
Referenced by QMetalCommandBuffer(), ~QMetalCommandBuffer(), QRhiMetal::beginPass(), endTempComputeEncoding(), QRhiMetal::enqueueShaderResourceBindings(), QRhiMetal::icbDraw(), QRhiMetal::lastCompletedGpuTime(), QMetalGraphicsPipeline::makeActiveForCurrentRenderPassEncoder(), rebindShaderResources(), resetPerPassCachedState(), resetState(), QRhiMetal::setVertexInput(), tempComputeEncoder(), and QRhiMetal::tessellatedDraw().
| bool QMetalCommandBuffer::hasBlendConstantsSet |
Definition at line 334 of file qrhimetal_p.h.
Referenced by endTempComputeEncoding(), resetPerPassCachedState(), and QRhiMetal::setBlendConstants().
| bool QMetalCommandBuffer::hasCustomScissorSet |
Definition at line 331 of file qrhimetal_p.h.
Referenced by endTempComputeEncoding(), resetPerPassCachedState(), QRhiMetal::setDefaultScissor(), QRhiMetal::setGraphicsPipeline(), and QRhiMetal::setScissor().
| bool QMetalCommandBuffer::hasStencilRefSet |
Definition at line 336 of file qrhimetal_p.h.
Referenced by endTempComputeEncoding(), resetPerPassCachedState(), and QRhiMetal::setStencilRef().
| QRhiMetalCommandBufferNativeHandles QMetalCommandBuffer::nativeHandlesStruct |
Definition at line 303 of file qrhimetal_p.h.
| PassType QMetalCommandBuffer::recordingPass |
Definition at line 312 of file qrhimetal_p.h.
Referenced by QRhiMetal::beginComputePass(), QRhiMetal::beginPass(), QRhiMetal::buildIndirect(), QRhiMetal::dispatch(), QRhiMetal::dispatchIndirect(), QRhiMetal::draw(), QRhiMetal::drawIndexed(), QRhiMetal::drawIndexedIndirect(), QRhiMetal::drawIndexedIndirectCount(), QRhiMetal::drawIndirect(), QRhiMetal::drawIndirectCount(), QRhiMetal::endComputePass(), QRhiMetal::endPass(), QRhiMetal::enqueueShaderResourceBindings(), QRhiMetal::executeIndirect(), resetPerPassState(), QRhiMetal::setBlendConstants(), QRhiMetal::setComputePipeline(), QRhiMetal::setGraphicsPipeline(), QRhiMetal::setScissor(), QRhiMetal::setShaderResources(), QRhiMetal::setStencilRef(), QRhiMetal::setVertexInput(), and QRhiMetal::setViewport().