Open 3D Engine Atom Gem API Reference  23.05.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 ([[maybe_unused]] RHI::ShadingRate rate, [[maybe_unused]] const RHI::ShadingRateCombinators &combinators=DefaultShadingRateCombinators) override
 
- Public Member Functions inherited from AZ::RHI::CommandList
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.
 
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
 
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

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.

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.

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.


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