Open 3D Engine Atom Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::Metal::CommandList Class Reference

Inherits AZ::RHI::CommandList, and AZ::Metal::CommandListBase.

Public Types

using MetalArgumentBufferArray = AZStd::array< id< MTLBuffer >, RHI::Limits::Pipeline::ShaderResourceGroupCountMax >
 
using MetalArgumentBufferArrayOffsets = AZStd::array< NSUInteger, RHI::Limits::Pipeline::ShaderResourceGroupCountMax >
 
using ResourceProperties = AZStd::pair< bool, id< MTLResource > >
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (CommandList, AZ::SystemAllocator)
 
void Init (RHI::HardwareQueueClass hardwareQueueClass, Device *device)
 
void Shutdown ()
 
void Close () override
 
void Reset () override
 
void FlushEncoder () override
 
void SetViewports (const RHI::Viewport *viewports, uint32_t count) override
 Assigns a list of viewports to the raster stage of the graphics pipe.
 
void SetScissors (const RHI::Scissor *scissors, uint32_t count) override
 Assigns a list of scissors to the raster stage of the graphics pipe.
 
void SetShaderResourceGroupForDraw (const RHI::ShaderResourceGroup &shaderResourceGroup) override
 
void SetShaderResourceGroupForDispatch (const RHI::ShaderResourceGroup &shaderResourceGroup) override
 
void Submit (const RHI::DrawItem &drawItem, uint32_t submitIndex=0) override
 Submits a single draw item for processing on the command list.
 
void Submit (const RHI::CopyItem &copyItem, uint32_t submitIndex=0) override
 Submits a single copy item for processing on the command list.
 
void Submit (const RHI::DispatchItem &dispatchItem, uint32_t submitIndex=0) override
 Submits a single dispatch item for processing on the command list.
 
void Submit (const RHI::DispatchRaysItem &dispatchRaysItem, uint32_t submitIndex=0) override
 Submits a single dispatch rays item for processing on the command list.
 
void BeginPredication (const RHI::Buffer &buffer, uint64_t offset, RHI::PredicationOp operation) override
 Starts predication on the command list.
 
void EndPredication () override
 End predication on the command list.
 
void BuildBottomLevelAccelerationStructure (const RHI::RayTracingBlas &rayTracingBlas) override
 Builds a Bottom Level Acceleration Structure (BLAS) for ray tracing operations, which is made up of RayTracingGeometry entries.
 
void BuildTopLevelAccelerationStructure (const RHI::RayTracingTlas &rayTracingTlas) override
 Builds a Top Level Acceleration Structure (TLAS) for ray tracing operations, which is made up of RayTracingInstance entries that refer to a BLAS entry.
 
void SetFragmentShadingRate (RHI::ShadingRate rate, const RHI::ShadingRateCombinators &combinators=DefaultShadingRateCombinators) override
 
- Public Member Functions inherited from AZ::RHI::CommandList
virtual void SetViewports (const Viewport *viewports, uint32_t count)=0
 Assigns a list of viewports to the raster stage of the graphics pipe.
 
virtual void SetScissors (const Scissor *scissors, uint32_t count)=0
 Assigns a list of scissors to the raster stage of the graphics pipe.
 
void SetScissor (const Scissor &scissor)
 Assigns a scissor to the raster stage of the graphics pipe.
 
void SetViewport (const Viewport &viewport)
 Assigns a viewport to the raster stage of the graphics pipe.
 
virtual void SetShaderResourceGroupForDraw (const ShaderResourceGroup &shaderResourceGroup)=0
 
virtual void SetShaderResourceGroupForDispatch (const ShaderResourceGroup &shaderResourceGroup)=0
 
virtual void Submit (const CopyItem &copyItem, uint32_t submitIndex=0)=0
 Submits a single copy item for processing on the command list.
 
virtual void Submit (const DrawItem &drawItem, uint32_t submitIndex=0)=0
 Submits a single draw item for processing on the command list.
 
virtual void Submit (const DispatchItem &dispatchItem, uint32_t submitIndex=0)=0
 Submits a single dispatch item for processing on the command list.
 
virtual void Submit (const DispatchRaysItem &dispatchRaysItem, uint32_t submitIndex=0)=0
 Submits a single dispatch rays item for processing on the command list.
 
virtual void BeginPredication (const Buffer &buffer, uint64_t offset, PredicationOp operation)=0
 Starts predication on the command list.
 
virtual void EndPredication ()=0
 End predication on the command list.
 
virtual void BuildBottomLevelAccelerationStructure (const RHI::RayTracingBlas &rayTracingBlas)=0
 Builds a Bottom Level Acceleration Structure (BLAS) for ray tracing operations, which is made up of RayTracingGeometry entries.
 
virtual void BuildTopLevelAccelerationStructure (const RHI::RayTracingTlas &rayTracingTlas)=0
 Builds a Top Level Acceleration Structure (TLAS) for ray tracing operations, which is made up of RayTracingInstance entries that refer to a BLAS entry.
 
void SetSubmitRange (const SubmitRange &submitRange)
 Sets the submit range for this command list.
 
void ValidateSubmitIndex (uint32_t submitIndex)
 Validates a submit index against the range for this command list, and tracks the total number of submits.
 
void ValidateTotalSubmits (const ScopeProducer *scopeProducer)
 Validates the total number of submits against the expected number.
 
void ResetTotalSubmits ()
 Resets the total number of submits.
 
virtual void SetFragmentShadingRate (ShadingRate rate, const ShadingRateCombinators &combinators=DefaultShadingRateCombinators)=0
 
- Public Member Functions inherited from AZ::Metal::CommandListBase
 CommandListBase (const CommandListBase &)=delete
 
virtual void Reset ()
 
virtual void Close ()
 
virtual void FlushEncoder ()
 
void Open (id< MTLCommandBuffer > mtlCommandBuffer)
 
void Open (id< MTLCommandEncoder > subEncoder, id< MTLCommandBuffer > mtlCommandBuffer)
 
bool IsEncoded ()
 This function returns true if the commandlist is going to encode something.
 
void SetRenderPassInfo (MTLRenderPassDescriptor *renderPassDescriptor, const RHI::MultisampleState renderPassMultisampleState, const AZStd::set< id< MTLHeap > > &residentHeaps)
 Cache render pass related data required to create an encoder or do validation checks.
 
void CreateEncoder (CommandEncoderType encoderType)
 
void WaitOnResourceFence (const Fence &fence)
 
void SignalResourceFence (const Fence &fence)
 
void AttachVisibilityBuffer (id< MTLBuffer > visibilityResultBuffer)
 Attach visibility buffer for occlusion testing.
 
void SetVisibilityResultMode (MTLVisibilityResultMode visibilityResultMode, size_t queryOffset)
 Support for binary/precise occlusion.
 
const id< MTLCommandBuffer > GetMtlCommandBuffer () const
 Get the Command buffer associated with this command list.
 
- Public Member Functions inherited from AZ::RHI::Object
 AZ_RTTI (Object, "{E43378F1-2331-4173-94B8-990ED20E6003}")
 
void SetName (const Name &name)
 Sets the name of the object.
 
const Name & GetName () const
 Returns the name set on the object by SetName.
 
uint32_t use_count ()
 Returns the current use count of the object.
 

Static Public Member Functions

static RHI::Ptr< CommandListCreate ()
 

Additional Inherited Members

- Static Public Attributes inherited from AZ::RHI::CommandList
static const ShadingRateCombinators DefaultShadingRateCombinators
 Default value of shading rate combinator operations.
 
- Protected Member Functions inherited from AZ::Metal::CommandListBase
void Init (RHI::HardwareQueueClass hardwareQueueClass, Device *device)
 
void Shutdown ()
 
void MakeHeapsResident (MTLRenderStages renderStages)
 Go through all the heaps and call UseHeap on them to make them resident for the upcoming pass.
 
template<typename T >
GetEncoder () const
 
- Protected Member Functions inherited from AZ::RHI::Object
void add_ref () const
 
void release () const
 
- Protected Attributes inherited from AZ::Metal::CommandListBase
id< MTLCommandEncoder > m_encoder = nil
 
CommandEncoderType m_commandEncoderType = Metal::CommandEncoderType::Invalid
 
RHI::MultisampleState m_renderPassMultiSampleState
 Cache multisample state. Used mainly to validate the MSAA image descriptor against the one passed into the pipelinestate.
 
ArgumentBuffer::ResourcesPerStageForGraphics m_untrackedResourcesGfxRead
 
ArgumentBuffer::ResourcesPerStageForGraphics m_untrackedResourcesGfxReadWrite
 
ArgumentBuffer::ResourcesForCompute m_untrackedResourcesComputeRead
 
ArgumentBuffer::ResourcesForCompute m_untrackedResourcesComputeReadWrite
 
Devicem_device = nullptr
 
- Protected Attributes inherited from AZ::RHI::Object
AZStd::atomic_int m_useCount = 0
 

Member Function Documentation

◆ BeginPredication()

void AZ::Metal::CommandList::BeginPredication ( const RHI::Buffer buffer,
uint64_t  offset,
RHI::PredicationOp  operation 
)
inlineoverridevirtual

Starts predication on the command list.

Implements AZ::RHI::CommandList.

◆ BuildBottomLevelAccelerationStructure()

void AZ::Metal::CommandList::BuildBottomLevelAccelerationStructure ( const RHI::RayTracingBlas rayTracingBlas)
overridevirtual

Builds a Bottom Level Acceleration Structure (BLAS) for ray tracing operations, which is made up of RayTracingGeometry entries.

Implements AZ::RHI::CommandList.

◆ BuildTopLevelAccelerationStructure()

void AZ::Metal::CommandList::BuildTopLevelAccelerationStructure ( const RHI::RayTracingTlas rayTracingTlas)
overridevirtual

Builds a Top Level Acceleration Structure (TLAS) for ray tracing operations, which is made up of RayTracingInstance entries that refer to a BLAS entry.

Implements AZ::RHI::CommandList.

◆ Close()

void AZ::Metal::CommandList::Close ( )
overridevirtual

Reimplemented from AZ::Metal::CommandListBase.

◆ EndPredication()

void AZ::Metal::CommandList::EndPredication ( )
inlineoverridevirtual

End predication on the command list.

Implements AZ::RHI::CommandList.

◆ FlushEncoder()

void AZ::Metal::CommandList::FlushEncoder ( )
overridevirtual

Reimplemented from AZ::Metal::CommandListBase.

◆ Reset()

void AZ::Metal::CommandList::Reset ( )
overridevirtual

Reimplemented from AZ::Metal::CommandListBase.

◆ SetFragmentShadingRate()

void AZ::Metal::CommandList::SetFragmentShadingRate ( RHI::ShadingRate  rate,
const RHI::ShadingRateCombinators &  combinators = DefaultShadingRateCombinators 
)
inlineoverridevirtual

Sets the Per-Draw shading rate value. This rate will be used for all subsequent draw calls of this command list. Combinators can also be specified as part of setting the rate. For ShadingRateCombinators = { Op1, Op2 }, the final value is calculated as Op2(Op1(PerDraw, PerPrimitive), PerRegion)

Implements AZ::RHI::CommandList.

◆ SetScissors()

void AZ::Metal::CommandList::SetScissors ( const RHI::Scissor scissors,
uint32_t  count 
)
overridevirtual

Assigns a list of scissors to the raster stage of the graphics pipe.

Implements AZ::RHI::CommandList.

◆ SetShaderResourceGroupForDispatch()

void AZ::Metal::CommandList::SetShaderResourceGroupForDispatch ( const RHI::ShaderResourceGroup shaderResourceGroup)
overridevirtual

Assigns a shader resource group for dispatch on compute pipe, at the binding slot determined by the layout used to create the shader resource group.

Parameters
shaderResourceGroupThe shader resource group to bind.

Implements AZ::RHI::CommandList.

◆ SetShaderResourceGroupForDraw()

void AZ::Metal::CommandList::SetShaderResourceGroupForDraw ( const RHI::ShaderResourceGroup shaderResourceGroup)
overridevirtual

Assigns a shader resource group for draw on the graphics pipe, at the binding slot determined by the layout used to create the shader resource group.

Parameters
shaderResourceGroupThe shader resource group to bind.

Implements AZ::RHI::CommandList.

◆ SetViewports()

void AZ::Metal::CommandList::SetViewports ( const RHI::Viewport viewports,
uint32_t  count 
)
overridevirtual

Assigns a list of viewports to the raster stage of the graphics pipe.

Implements AZ::RHI::CommandList.

◆ Shutdown()

void AZ::Metal::CommandList::Shutdown ( )
virtual

Shuts down the object. Derived classes can make this public if it fits with their lifecycle model (i.e. if they use an explicit Init / Shutdown). By default, it is private in order to maintain consistency with a simpler RAII lifecycle.

Reimplemented from AZ::RHI::Object.

◆ Submit() [1/4]

void AZ::Metal::CommandList::Submit ( const RHI::CopyItem copyItem,
uint32_t  submitIndex = 0 
)
overridevirtual

Submits a single copy item for processing on the command list.

Implements AZ::RHI::CommandList.

◆ Submit() [2/4]

void AZ::Metal::CommandList::Submit ( const RHI::DispatchItem dispatchItem,
uint32_t  submitIndex = 0 
)
overridevirtual

Submits a single dispatch item for processing on the command list.

Implements AZ::RHI::CommandList.

◆ Submit() [3/4]

void AZ::Metal::CommandList::Submit ( const RHI::DispatchRaysItem dispatchRaysItem,
uint32_t  submitIndex = 0 
)
overridevirtual

Submits a single dispatch rays item for processing on the command list.

Implements AZ::RHI::CommandList.

◆ Submit() [4/4]

void AZ::Metal::CommandList::Submit ( const RHI::DrawItem drawItem,
uint32_t  submitIndex = 0 
)
overridevirtual

Submits a single draw item for processing on the command list.

Implements AZ::RHI::CommandList.


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