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::ArgumentBuffer Class Referencefinal

This class manages all the native objects associated with a ShaderResourceGroup. More...

#include <ArgumentBuffer.h>

Inherits AZ::RHI::DeviceObject.

Public Types

using ResourcesForCompute = AZStd::unordered_set< id< MTLResource >, MetalResourceHash >
 
using ResourcesPerStageForGraphics = AZStd::array< AZStd::unordered_set< id< MTLResource >, MetalResourceHash >, RHI::ShaderStageGraphicsCount >
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (ArgumentBuffer, AZ::SystemAllocator)
 
 AZ_RTTI (ArgumentBuffer, "FEFE8823-7772-4EA0-9241-65C49ADFF6B3", Base)
 
void Init (Device *device, RHI::ConstPtr< RHI::ShaderResourceGroupLayout > srgLayout, ShaderResourceGroupPool *srgPool)
 
void Init (Device *device, AZStd::vector< MTLArgumentDescriptor * > argBufferDescriptors, AZStd::string argBufferName)
 
void UpdateImageViews (const RHI::ShaderInputImageDescriptor &shaderInputImage, const AZStd::span< const RHI::ConstPtr< RHI::ImageView > > &imageViews)
 
void UpdateSamplers (const RHI::ShaderInputSamplerDescriptor &shaderInputSampler, const AZStd::span< const RHI::SamplerState > &samplerStates)
 
void UpdateBufferViews (const RHI::ShaderInputBufferDescriptor &shaderInputBuffer, const AZStd::span< const RHI::ConstPtr< RHI::BufferView > > &bufferViews)
 
void UpdateConstantBufferViews (AZStd::span< const uint8_t > rawData)
 
id< MTLBuffer > GetArgEncoderBuffer () const
 Return the native MTLBuffer that holds SRG data.
 
const id< MTLArgumentEncoder > GetArgEncoder () const
 Return the native Argument buffer encoder is used to write into the native MTLBuffer.
 
size_t GetOffset () const
 Return the offset associated with the native MTLBuffer for this argument buffer.
 
void CollectUntrackedResources (const ShaderResourceGroupVisibility &srgResourcesVisInfo, ResourcesPerStageForGraphics &untrackedResourcesRead, ResourcesPerStageForGraphics &untrackedResourcesReadWrite) const
 
void CollectUntrackedResources (const ShaderResourceGroupVisibility &srgResourcesVisInfo, ResourcesForCompute &untrackedResourceComputeRead, ResourcesForCompute &untrackedResourceComputeReadWrite) const
 
bool IsNullHeapNeededForVertexStage (const ShaderResourceGroupVisibility &srgResourcesVisInfo) const
 
bool IsNullDescHeapNeeded () const
 
void UpdateTextureView (id< MTLTexture > mtlTexture, uint32_t index)
 Update the texture related descriptor at a specific id index within the Argument buffer.
 
void UpdateBufferView (id< MTLBuffer > mtlBuffer, uint32_t offset, uint32_t index)
 Update the buffer related descriptor at a specific id index within the Argument buffer.
 
void Shutdown () override
 Clears the current bound device to null.
 
- Public Member Functions inherited from AZ::RHI::DeviceObject
 AZ_RTTI (DeviceObject, "{17D34F71-944C-4AF5-9823-627474C4C0A6}", Object)
 
bool IsInitialized () const
 Returns whether the device object is initialized.
 
DeviceGetDevice () const
 
- 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< ArgumentBufferCreate ()
 

Additional Inherited Members

- Protected Member Functions inherited from AZ::RHI::DeviceObject
void Init (Device &device)
 The derived class should call this method to assign the device.
 
void Shutdown () override
 Clears the current bound device to null.
 
- Protected Member Functions inherited from AZ::RHI::Object
void add_ref () const
 
void release () const
 
- Protected Attributes inherited from AZ::RHI::Object
AZStd::atomic_int m_useCount = 0
 

Detailed Description

This class manages all the native objects associated with a ShaderResourceGroup.

Member Function Documentation

◆ Shutdown()

void AZ::Metal::ArgumentBuffer::Shutdown ( )
overridevirtual

Clears the current bound device to null.

Reimplemented from AZ::RHI::DeviceObject.


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