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::CommandListBase Class Referenceabstract

Inherits AZ::RHI::Object.

Inherited by AZ::Metal::CommandList.

Public Member Functions

 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.
 

Protected Member Functions

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

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

◆ Open() [1/2]

void AZ::Metal::CommandListBase::Open ( id< MTLCommandBuffer >  mtlCommandBuffer)

This function is called to indicate that this commandlist is open for encoding. We cant open the encoder here and have to create it lazily because we don't know the type of work the CommandList will do until 'Submit' is called.

Parameters
mtlCommandBufferThe command buffer that is assigned to this command list to be used to create the encoder

◆ Open() [2/2]

void AZ::Metal::CommandListBase::Open ( id< MTLCommandEncoder >  subEncoder,
id< MTLCommandBuffer >  mtlCommandBuffer 
)
Parameters
subEncoder- Since subRenderEncoders are created by higher level code (in order to maintain correct ordering) they can be directly provided to the commandlist to order to be used for encoding. SubEncoders only apply to Graphics related work.
mtlCommandBuffer- The command buffer that is assigned to this command list to be used for fencing related commands

◆ Shutdown()

void AZ::Metal::CommandListBase::Shutdown ( )
protectedvirtual

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: