Open 3D Engine Atom Gem API Reference 26.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::Device Class Referencefinal

Inherits AZ::RHI::Device.

Public Member Functions

 AZ_CLASS_ALLOCATOR (Device, AZ::SystemAllocator)
 
 AZ_RTTI (Device, "{04DA2F69-1E6F-42A1-B4F0-7ADC127A5AAB}", Base)
 
MemoryView CreateImageCommitted (const RHI::ImageDescriptor &imageDescriptor)
 
MemoryView CreateImageCommitted (const RHI::ImageDescriptor &imageDescriptor, MTLStorageMode overrideStorageMode)
 
MemoryView CreateImagePlaced (const RHI::ImageDescriptor &imageDescriptor, id< MTLHeap > mtlHeap, size_t heapByteOffset, MTLSizeAndAlign textureSizeAndAlign)
 
MemoryView CreateImagePlaced (const RHI::ImageDescriptor &imageDescriptor, id< MTLHeap > mtlHeap, size_t heapByteOffset, MTLSizeAndAlign textureSizeAndAlign, MTLTextureType overrideTextureType)
 
MemoryView CreateBufferCommitted (const RHI::BufferDescriptor &bufferDescriptor, RHI::HeapMemoryLevel heapMemoryLevel=RHI::HeapMemoryLevel::Device)
 
MemoryView CreateBufferPlaced (const RHI::BufferDescriptor &bufferDescriptor, id< MTLHeap > mtlHeap, size_t heapByteOffset, MTLSizeAndAlign bufferSizeAndAlign)
 
MemoryView CreateResourceCommitted (ResourceDescriptor resourceDesc)
 
id< MTLDevice > GetMtlDevice ()
 
MTLSharedEventListener * GetSharedEventListener ()
 
void QueueDeferredRelease (RHI::Ptr< RHI::Object > object)
 
CommandListPool & GetCommandListPool (RHI::HardwareQueueClass hardwareQueueClass)
 
CommandQueue & GetGraphicsCommandQueue ()
 
const CommandQueue & GetGraphicsCommandQueue () const
 
CommandQueue & GetCopyCommandQueue ()
 
const CommandQueue & GetCopyCommandQueue () const
 
CommandQueue & GetComputeCommandQueue ()
 
const CommandQueue & GetComputeCommandQueue () const
 
CommandList * AcquireCommandList (RHI::HardwareQueueClass hardwareQueueClass)
 
void QueueForRelease (const MemoryView &memoryView)
 
void QueueForRelease (Memory *memory)
 
RHI::ConstPtr< PipelineLayout > AcquirePipelineLayout (const RHI::PipelineLayoutDescriptor &descriptor)
 Acquires a pipeline layout from the internal cache.
 
RHI::Ptr< Buffer > AcquireStagingBuffer (AZStd::size_t byteCount, RHI::BufferBindFlags bufferBindFlags)
 
CommandQueueContext & GetCommandQueueContext ()
 
const CommandQueueContext & GetCommandQueueContext () const
 
AsyncUploadQueue & GetAsyncUploadQueue ()
 
const AsyncUploadQueue & GetAsyncUploadQueue () const
 
const NSCache * GetSamplerCache () const
 
BufferMemoryAllocator & GetArgBufferConstantBufferAllocator ()
 
BufferMemoryAllocator & GetArgumentBufferAllocator ()
 
NullDescriptorManager & GetNullDescriptorManager ()
 
RHI::ResourceMemoryRequirements GetResourceMemoryRequirements (const RHI::ImageDescriptor &descriptor) override
 Get the memory requirements for allocating an image resource.
 
RHI::ResourceMemoryRequirements GetResourceMemoryRequirements (const RHI::BufferDescriptor &descriptor) override
 Get the memory requirements for allocating a buffer resource.
 
void ObjectCollectionNotify (RHI::ObjectCollectorNotifyFunction notifyFunction) override
 Notifies after all objects currently in the platform release queue are released.
 
BindlessArgumentBuffer & GetBindlessArgumentBuffer ()
 
RHI::ResultCode ClearRenderAttachments (CommandList &commandList, MTLRenderPassDescriptor *renderpassDesc, const AZStd::vector< ClearAttachments::ClearData > &clearAttachmentData)
 
- Public Member Functions inherited from AZ::RHI::Device
 AZ_RTTI (Device, "{C7E70BE4-3AA5-4214-91E6-52A8ECC31A34}", Object)
 
bool IsInitialized () const
 Returns whether the device is initialized.
 
ResultCode Init (int deviceIndex, PhysicalDevice &physicalDevice)
 
ResultCode BeginFrame ()
 
ResultCode EndFrame ()
 
ResultCode WaitForIdle ()
 
ResultCode CompileMemoryStatistics (MemoryStatistics &memoryStatistics, MemoryStatisticsReportFlags reportFlags)
 
ResultCode UpdateCpuTimingStatistics () const
 
const PhysicalDevice & GetPhysicalDevice () const
 Returns the physical device associated with this device.
 
int GetDeviceIndex () const
 Returns the device index.
 
const DeviceDescriptor & GetDescriptor () const
 Returns the descriptor associated with the device.
 
const DeviceFeatures & GetFeatures () const
 Returns the set of features supported by this device.
 
const DeviceLimits & GetLimits () const
 Returns the set of hardware limits for this device.
 
const ResourcePoolDatabase & GetResourcePoolDatabase () const
 Returns the resource pool database.
 
ResourcePoolDatabase & GetResourcePoolDatabase ()
 Returns the mutable resource pool database.
 
FormatCapabilities GetFormatCapabilities (Format format) const
 Returns a union of all capabilities of a specific format.
 
Format GetNearestSupportedFormat (Format requestedFormat, FormatCapabilities requestedCapabilities) const
 Return the nearest supported format for this device.
 
ResultCode InitBindlessSrg (RHI::Ptr< RHI::ShaderResourceGroupLayout > bindlessSrgLayout)
 
virtual RHI::ResultCode CompactSRGMemory ()
 Allows the back-ends to compact SRG related memory if applicable.
 
bool WasDeviceRemoved ()
 
void SetDeviceRemoved ()
 
void SetLastExecutingScope (const AZStd::string_view scopeName)
 
AZStd::string_view GetLastExecutingScope () const
 
virtual Ptr< XRDeviceDescriptor > BuildXRDescriptor () const
 Builds an implementation specific XR device descriptor based on this graphics device.
 
- 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< Device > Create ()
 

Additional Inherited Members

- Protected Types inherited from AZ::RHI::Device
using FormatCapabilitiesList = AZStd::array< FormatCapabilities, static_cast< uint32_t >(Format::Count)>
 
- Protected Member Functions inherited from AZ::RHI::Object
void add_ref () const
 
void release () const
 
- Protected Attributes inherited from AZ::RHI::Device
DeviceFeatures m_features
 
DeviceLimits m_limits
 
ResourcePoolDatabase m_resourcePoolDatabase
 
DeviceDescriptor m_descriptor
 
- Protected Attributes inherited from AZ::RHI::Object
AZStd::atomic_int m_useCount = 0
 

Member Function Documentation

◆ AcquireCommandList()

CommandList * AZ::Metal::Device::AcquireCommandList ( RHI::HardwareQueueClass  hardwareQueueClass)

Acquires a new command list for the frame given the hardware queue class. The command list is automatically reclaimed after the current frame has flushed through the GPU.

◆ GetResourceMemoryRequirements() [1/2]

RHI::ResourceMemoryRequirements AZ::Metal::Device::GetResourceMemoryRequirements ( const RHI::BufferDescriptor &  descriptor)
overridevirtual

Get the memory requirements for allocating a buffer resource.

Implements AZ::RHI::Device.

◆ GetResourceMemoryRequirements() [2/2]

RHI::ResourceMemoryRequirements AZ::Metal::Device::GetResourceMemoryRequirements ( const RHI::ImageDescriptor &  descriptor)
overridevirtual

Get the memory requirements for allocating an image resource.

Implements AZ::RHI::Device.

◆ ObjectCollectionNotify()

void AZ::Metal::Device::ObjectCollectionNotify ( RHI::ObjectCollectorNotifyFunction  notifyFunction)
overridevirtual

Notifies after all objects currently in the platform release queue are released.

Implements AZ::RHI::Device.

◆ QueueDeferredRelease()

void AZ::Metal::Device::QueueDeferredRelease ( RHI::Ptr< RHI::Object >  object)

Releases an object through the garbage collector, which will defer release until the current GPU frame has been flushed.

◆ QueueForRelease()

void AZ::Metal::Device::QueueForRelease ( const MemoryView &  memoryView)

Queues the backing Memory instance of a MemoryView for release (by taking a reference) after the current frame has flushed through the GPU. The reference on the MemoryView itself is not released.


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