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::MultiDevicePipelineLibrary Class Reference

#include <MultiDevicePipelineLibrary.h>

Inherits AZ::RHI::MultiDeviceObject.

Public Member Functions

 AZ_CLASS_ALLOCATOR (MultiDevicePipelineLibrary, AZ::SystemAllocator, 0)
 
 AZ_RTTI (MultiDevicePipelineLibrary, "{B48B6A46-5976-4D7D-AA14-2179D871C567}")
 
Ptr< PipelineLibraryGetDevicePipelineLibrary (int deviceIndex) const
 Returns the device-specific PipelineLibrary for the given index.
 
ResultCode Init (MultiDevice::DeviceMask deviceMask, const MultiDevicePipelineLibraryDescriptor &descriptor)
 
ResultCode MergeInto (AZStd::span< const MultiDevicePipelineLibrary *const > librariesToMerge)
 
ConstPtr< PipelineLibraryDataGetSerializedData (int deviceIndex=RHI::MultiDevice::DefaultDeviceIndex) 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.
 
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

- Protected Member Functions inherited from AZ::RHI::MultiDeviceObject
void Init (MultiDevice::DeviceMask deviceMask)
 The derived class should call this method to assign the device.
 
void Shutdown () override
 Clears the current bound device to null.
 
template<typename T >
void IterateDevices (T callback)
 Helper method that will iterate over all selected devices and call the provided callback.
 
- 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

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

Member Function Documentation

◆ GetSerializedData()

ConstPtr< PipelineLibraryData > AZ::RHI::MultiDevicePipelineLibrary::GetSerializedData ( int  deviceIndex = RHI::MultiDevice::DefaultDeviceIndex) 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::MultiDevicePipelineLibrary::Init ( MultiDevice::DeviceMask  deviceMask,
const MultiDevicePipelineLibraryDescriptor descriptor 
)

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

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

◆ IsMergeRequired()

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

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

◆ MergeInto()

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

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

Parameters
librariesToMergeA span of libraries to merge into this library

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