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::RHI::Factory Class Referenceabstract

#include <Factory.h>

Inherited by AZ::DX12::SystemComponent, AZ::Metal::SystemComponent, AZ::Null::SystemComponent, and AZ::Vulkan::SystemComponent.

Public Member Functions

 AZ_TYPE_INFO (Factory, "{2C0231FD-DD11-4154-A4F5-177181E26D8E}")
 
 AZ_DISABLE_COPY_MOVE (Factory)
 
virtual Name GetName ()=0
 Returns the name of the Factory.
 
virtual APIType GetType ()=0
 Returns the APIType of the factory.
 
virtual APIPriority GetDefaultPriority ()=0
 Returns the default priority of the factory in case there's no priorities set in the FactoryManager.
 
virtual bool SupportsXR () const =0
 Returns true if the factory supports XR api.
 
virtual uint32_t GetAPIUniqueIndex () const =0
 
virtual PhysicalDeviceList EnumeratePhysicalDevices ()=0
 
virtual Ptr< BufferCreateBuffer ()=0
 
virtual Ptr< BufferPoolCreateBufferPool ()=0
 
virtual Ptr< BufferViewCreateBufferView ()=0
 
virtual Ptr< DeviceCreateDevice ()=0
 
virtual Ptr< FenceCreateFence ()=0
 
virtual Ptr< FrameGraphCompilerCreateFrameGraphCompiler ()=0
 
virtual Ptr< FrameGraphExecuterCreateFrameGraphExecuter ()=0
 
virtual Ptr< ImageCreateImage ()=0
 
virtual Ptr< ImagePoolCreateImagePool ()=0
 
virtual Ptr< ImageViewCreateImageView ()=0
 
virtual Ptr< StreamingImagePoolCreateStreamingImagePool ()=0
 
virtual Ptr< PipelineStateCreatePipelineState ()=0
 
virtual Ptr< PipelineLibraryCreatePipelineLibrary ()=0
 
virtual Ptr< ScopeCreateScope ()=0
 
virtual Ptr< ShaderResourceGroupCreateShaderResourceGroup ()=0
 
virtual Ptr< ShaderResourceGroupPoolCreateShaderResourceGroupPool ()=0
 
virtual Ptr< SwapChainCreateSwapChain ()=0
 
virtual Ptr< TransientAttachmentPoolCreateTransientAttachmentPool ()=0
 
virtual Ptr< QueryPoolCreateQueryPool ()=0
 
virtual Ptr< QueryCreateQuery ()=0
 
virtual Ptr< IndirectBufferSignatureCreateIndirectBufferSignature ()=0
 
virtual Ptr< IndirectBufferWriterCreateIndirectBufferWriter ()=0
 
virtual Ptr< RayTracingBufferPoolsCreateRayTracingBufferPools ()=0
 
virtual Ptr< RayTracingBlasCreateRayTracingBlas ()=0
 
virtual Ptr< RayTracingTlasCreateRayTracingTlas ()=0
 
virtual Ptr< RayTracingPipelineStateCreateRayTracingPipelineState ()=0
 
virtual Ptr< RayTracingShaderTableCreateRayTracingShaderTable ()=0
 

Static Public Member Functions

static uint32_t GetComponentService ()
 Returns the component service name CRC used by the platform RHI system component.
 
static uint32_t GetManagerComponentService ()
 Returns the component service name CRC used by the Factory manager component.
 
static uint32_t GetPlatformService ()
 Returns the component service name CRC used by the platform RHI system component.
 
static void Register (Factory *instance)
 Registers the global factory instance.
 
static void Unregister (Factory *instance)
 Unregisters the global factory instance.
 
static bool IsReady ()
 Returns whether the factory is initialized and active in this module.
 
static FactoryGet ()
 Access the global factory instance.
 
static bool IsRenderDocModuleLoaded ()
 Returns true if RenderDoc dll is loaded.
 
static bool IsPixModuleLoaded ()
 Returns true if Pix dll is loaded.
 
static bool PixGpuEventsEnabled ()
 Returns true if Pix GPU events should be emitted.
 
static bool UsingWarpDevice ()
 Returns true if Warp is enabled.
 

Detailed Description

The factory is an interface for creating RHI data structures. The platform system should register itself with the factory by calling Register, and unregister on shutdown with Unregister.

A call to Get will return the active instance. In the event that it's unclear whether a platform instance exists, you must call IsReady to determine whether it's safe to call Get. Calling Get without a registered platform will result in an assert.

Member Function Documentation

◆ CreateBuffer()

virtual Ptr< Buffer > AZ::RHI::Factory::CreateBuffer ( )
pure virtual

Factory Creation Methods:

Returns the platform-specific derived variant of the RHI type. All instances are created in an uninitialized state; the operation simply allocates the memory for the appropriate platform type and returns the pointer.

Implemented in AZ::DX12::SystemComponent, AZ::Metal::SystemComponent, AZ::Null::SystemComponent, and AZ::Vulkan::SystemComponent.

◆ EnumeratePhysicalDevices()

virtual PhysicalDeviceList AZ::RHI::Factory::EnumeratePhysicalDevices ( )
pure virtual

Collects the set of physical devices on the system and returns a list of them. Physical devices represent the hardware attached to the system. Physical devices can be grouped into nodes for linked setups (e.g. SLI / Crossfire). They can also represent software reference implementations. Check the PhysicalDeviceType on the descriptor to inspect this information.

Implemented in AZ::DX12::SystemComponent, AZ::Metal::SystemComponent, AZ::Null::SystemComponent, and AZ::Vulkan::SystemComponent.

◆ GetAPIUniqueIndex()

virtual uint32_t AZ::RHI::Factory::GetAPIUniqueIndex ( ) const
pure virtual

Purpose: The API Unique Index will be encoded in the 2 Most Significant Bits of a ShaderVariantAsset ProductSubId (a 32bits integer). Returns a number in the range [0..3]. In theory any given AssetBuilderSdk::PlatformInfo can support several RHI::APITypes. In reality "pc" only supports DX12 & Vulkan. "ios" supports only Metal. "mac" supports only Metal. "android" supports only Vulkan. So, for all practical purposes, a single PlatformInfo won't support more than 2 ShaderPlatformInterfaces, but for the sake of hedging our bets into the future We assume no more than 4 ShaderPlatformInterfaces will ever be supported for any given PlatformInfo. REMARK: It is the responsibility of the Factory subclass to return a unique number between 0...3. For example DX12 can return 0, while Vulkan should return 1 (Satisfies "pc", "android" and "linux"). Metal can return 0 because it is the only ShaderPlatformInterface for "ios", "mac" and "appletv". See AZ::RHI::Limits::APIType::PerPlatformApiUniqueIndexMax.

Implemented in AZ::DX12::SystemComponent, AZ::Metal::SystemComponent, AZ::Null::SystemComponent, and AZ::Vulkan::SystemComponent.

◆ GetDefaultPriority()

virtual APIPriority AZ::RHI::Factory::GetDefaultPriority ( )
pure virtual

Returns the default priority of the factory in case there's no priorities set in the FactoryManager.

Implemented in AZ::DX12::SystemComponent, AZ::Metal::SystemComponent, AZ::Null::SystemComponent, and AZ::Vulkan::SystemComponent.

◆ GetName()

virtual Name AZ::RHI::Factory::GetName ( )
pure virtual

◆ GetType()

virtual APIType AZ::RHI::Factory::GetType ( )
pure virtual

◆ SupportsXR()

virtual bool AZ::RHI::Factory::SupportsXR ( ) const
pure virtual

Returns true if the factory supports XR api.

Implemented in AZ::DX12::SystemComponent, AZ::Metal::SystemComponent, AZ::Null::SystemComponent, and AZ::Vulkan::SystemComponent.


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