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
QMetalCommandBuffer Struct Reference

#include <qrhimetal_p.h>

+ Inheritance diagram for QMetalCommandBuffer:
+ Collaboration diagram for QMetalCommandBuffer:

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
}
 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 QRhiNativeHandlesnativeHandles ()
 
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 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.
 
const QRhiNativeHandlesnativeHandles ()
 
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
 
QRhirhi () const
 

Public Attributes

QMetalCommandBufferDatad = nullptr
 
QRhiMetalCommandBufferNativeHandles nativeHandlesStruct
 
PassType recordingPass
 
QRhiRenderTargetcurrentTarget
 
QMetalGraphicsPipelinecurrentGraphicsPipeline
 
QMetalComputePipelinecurrentComputePipeline
 
uint currentPipelineGeneration
 
QMetalShaderResourceBindingscurrentGraphicsSrb
 
QMetalShaderResourceBindingscurrentComputeSrb
 
uint currentSrbGeneration
 
int currentResSlot
 
QMetalBuffercurrentIndexBuffer
 
quint32 currentIndexOffset
 
QRhiCommandBuffer::IndexFormat currentIndexFormat
 
int currentCullMode
 
int currentTriangleFillMode
 
int currentFrontFaceWinding
 
std::pair< float, float > currentDepthBiasValues
 

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
QRhiImplementationm_rhi = nullptr
 
quint64 m_id
 
QByteArray m_objectName
 

Detailed Description

Definition at line 265 of file qrhimetal_p.h.

Member Enumeration Documentation

◆ PassType

Enumerator
NoPass 
RenderPass 
ComputePass 

Definition at line 274 of file qrhimetal_p.h.

Constructor & Destructor Documentation

◆ QMetalCommandBuffer()

QMetalCommandBuffer::QMetalCommandBuffer ( QRhiImplementation * rhi)

Definition at line 6185 of file qrhimetal.mm.

◆ ~QMetalCommandBuffer()

QMetalCommandBuffer::~QMetalCommandBuffer ( )

Definition at line 6192 of file qrhimetal.mm.

Member Function Documentation

◆ destroy()

void QMetalCommandBuffer::destroy ( )
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.

Note
Resources referenced by commands for the current frame should not be released until the frame is submitted by QRhi::endFrame().

The QRhiResource destructor also performs the same task, so calling this function is not necessary before deleting a QRhiResource.

See also
deleteLater()

Implements QRhiResource.

Definition at line 6198 of file qrhimetal.mm.

◆ nativeHandles()

const QRhiNativeHandles * QMetalCommandBuffer::nativeHandles ( )

Definition at line 6203 of file qrhimetal.mm.

◆ resetPerPassCachedState()

void QMetalCommandBuffer::resetPerPassCachedState ( )

Definition at line 6227 of file qrhimetal.mm.

◆ resetPerPassState()

void QMetalCommandBuffer::resetPerPassState ( )

Definition at line 6220 of file qrhimetal.mm.

◆ resetState()

void QMetalCommandBuffer::resetState ( double lastGpuTime = 0)

Definition at line 6210 of file qrhimetal.mm.

Member Data Documentation

◆ currentComputePipeline

QMetalComputePipeline* QMetalCommandBuffer::currentComputePipeline

Definition at line 286 of file qrhimetal_p.h.

◆ currentComputeSrb

QMetalShaderResourceBindings* QMetalCommandBuffer::currentComputeSrb

Definition at line 289 of file qrhimetal_p.h.

◆ currentCullMode

int QMetalCommandBuffer::currentCullMode

Definition at line 295 of file qrhimetal_p.h.

◆ currentDepthBiasValues

std::pair<float, float> QMetalCommandBuffer::currentDepthBiasValues

Definition at line 298 of file qrhimetal_p.h.

◆ currentFrontFaceWinding

int QMetalCommandBuffer::currentFrontFaceWinding

Definition at line 297 of file qrhimetal_p.h.

◆ currentGraphicsPipeline

QMetalGraphicsPipeline* QMetalCommandBuffer::currentGraphicsPipeline

Definition at line 285 of file qrhimetal_p.h.

◆ currentGraphicsSrb

QMetalShaderResourceBindings* QMetalCommandBuffer::currentGraphicsSrb

Definition at line 288 of file qrhimetal_p.h.

◆ currentIndexBuffer

QMetalBuffer* QMetalCommandBuffer::currentIndexBuffer

Definition at line 292 of file qrhimetal_p.h.

◆ currentIndexFormat

QRhiCommandBuffer::IndexFormat QMetalCommandBuffer::currentIndexFormat

Definition at line 294 of file qrhimetal_p.h.

◆ currentIndexOffset

quint32 QMetalCommandBuffer::currentIndexOffset

Definition at line 293 of file qrhimetal_p.h.

◆ currentPipelineGeneration

uint QMetalCommandBuffer::currentPipelineGeneration

Definition at line 287 of file qrhimetal_p.h.

◆ currentResSlot

int QMetalCommandBuffer::currentResSlot

Definition at line 291 of file qrhimetal_p.h.

◆ currentSrbGeneration

uint QMetalCommandBuffer::currentSrbGeneration

Definition at line 290 of file qrhimetal_p.h.

◆ currentTarget

QRhiRenderTarget* QMetalCommandBuffer::currentTarget

Definition at line 282 of file qrhimetal_p.h.

◆ currentTriangleFillMode

int QMetalCommandBuffer::currentTriangleFillMode

Definition at line 296 of file qrhimetal_p.h.

◆ d

QMetalCommandBufferData* QMetalCommandBuffer::d = nullptr

Definition at line 271 of file qrhimetal_p.h.

◆ nativeHandlesStruct

QRhiMetalCommandBufferNativeHandles QMetalCommandBuffer::nativeHandlesStruct

Definition at line 272 of file qrhimetal_p.h.

◆ recordingPass

PassType QMetalCommandBuffer::recordingPass

Definition at line 281 of file qrhimetal_p.h.


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