Open 3D Engine Atom Gem API Reference 25.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::PipelineLibrary Class Reference

#include <PipelineLibrary.h>

Inherits AZ::RHI::MultiDeviceObject.

Public Member Functions

 AZ_CLASS_ALLOCATOR (PipelineLibrary, AZ::SystemAllocator, 0)
 
 AZ_RTTI (PipelineLibrary, "{B48B6A46-5976-4D7D-AA14-2179D871C567}")
 
 AZ_RHI_MULTI_DEVICE_OBJECT_GETTER (PipelineLibrary)
 
ResultCode Init (MultiDevice::DeviceMask deviceMask, const PipelineLibraryDescriptor &descriptor)
 
ResultCode MergeInto (AZStd::span< const PipelineLibrary *const > librariesToMerge)
 
auto GetSerializedDataMap () const
 
bool SaveSerializedData (const AZStd::unordered_map< int, AZStd::string > &filePaths) const
 
virtual bool IsMergeRequired () const
 
- Public Member Functions inherited from AZ::RHI::MultiDeviceObject
 AZ_RTTI (MultiDeviceObject, "{17D34F71-944C-4AF5-9823-627474C4C0A6}", Object)
 
bool IsInitialized () const
 Returns whether the device object is initialized.
 
AZ_FORCE_INLINE bool IsDeviceSet (int deviceIndex) const
 
MultiDevice::DeviceMask GetDeviceMask () 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.
 

Additional Inherited Members

- Static Public Member Functions inherited from AZ::RHI::MultiDeviceObject
template<typename T >
static AZ_FORCE_INLINE void IterateDevices (MultiDevice::DeviceMask deviceMask, T callback)
 
- Protected Member Functions inherited from AZ::RHI::MultiDeviceObject
void Init (MultiDevice::DeviceMask deviceMask)
 The derived class should call this method to assign the device.
 
template<typename T >
AZ_FORCE_INLINE void IterateDevices (T callback)
 Helper method that will iterate over all selected devices and call the provided callback.
 
template<typename T , typename U >
AZ_FORCE_INLINE decltype(auto) IterateObjects (U callback)
 
template<typename T , typename U >
AZ_FORCE_INLINE decltype(auto) IterateObjects (U callback) const
 
template<typename T >
AZ_FORCE_INLINE Ptr< T > GetDeviceObject (int deviceIndex) const
 
- Protected Member Functions inherited from AZ::RHI::Object
void add_ref () const
 
void release () const
 
- Protected Attributes inherited from AZ::RHI::MultiDeviceObject
AZStd::unordered_map< int, Ptr< DeviceObject > > m_deviceObjects
 A map of all device-specific objects, indexed by the device index.
 
- Protected Attributes inherited from AZ::RHI::Object
AZStd::atomic_int m_useCount = 0
 

Detailed Description

PipelineLibrary is a multi-device class (representing a DevicePipelineLibrary on multiple devices). It holds a map of device-specific DevicePipelineLibrary objects, which can be addressed with a device index. The class is initialized with a device mask (1 bit per device), which initializes one DevicePipelineLibrary for each bit set and stores them in a map. The API then forwards all calls to the all device-specific DevicePipelineLibrary objects by iterating over them and forwarding the call. A device-specific DevicePipelineLibrary can be accessed by calling GetDevicePipelineLibrary with the corresponding device index

Member Function Documentation

◆ GetSerializedDataMap()

auto AZ::RHI::PipelineLibrary::GetSerializedDataMap ( ) const
inline

Serializes the platform-specific data and returns it as a new PipelineLibraryData instance for a specific device

Parameters
deviceIndexDenotes from which device the serialized data should be retrieved

◆ Init()

ResultCode AZ::RHI::PipelineLibrary::Init ( MultiDevice::DeviceMask  deviceMask,
const PipelineLibraryDescriptor descriptor 
)

For all devices selected via the deviceMask, a DevicePipelineLibrary is initialized and stored internally in a map (mapping from device index to a device-specific DevicePipelineLibrary). A device-specific descriptor (retrieved from PipelineLibraryDescriptor) is passed to the respective initialized methods of the device-specific DevicePipelineLibrary.

Parameters
deviceMaskA bitmask selecting on which devices a DevicePipelineLibrary should be initialized
descriptorThe descriptor needed to init the PipelineLibrary.

◆ IsMergeRequired()

virtual bool AZ::RHI::PipelineLibrary::IsMergeRequired ( ) const
virtual

Returns whether the current library need to be merged Returns true if any of the device-specific DevicePipelineLibrary objects needs to be merged

◆ MergeInto()

ResultCode AZ::RHI::PipelineLibrary::MergeInto ( AZStd::span< const PipelineLibrary *const >  librariesToMerge)

Forwards the call to all device-specific PipelineLibraries, for each device-specific DevicePipelineLibrary, extracting the corresponding DevicePipelineLibrary(ies) from librariesToMerge and passing them on.

Parameters
librariesToMergeA span of libraries to merge into this library

◆ SaveSerializedData()

bool AZ::RHI::PipelineLibrary::SaveSerializedData ( const AZStd::unordered_map< int, AZStd::string > &  filePaths) const

Saves the platform-specific data to disk using the device-specific filePath provided. This is done through RHI backend drivers for each device.


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