#include <MultiDeviceObject.h>
Inherits AZ::RHI::Object.
Inherited by AZ::RHI::Fence, AZ::RHI::IndirectBufferSignature, AZ::RHI::PipelineLibrary, AZ::RHI::PipelineState, AZ::RHI::RayTracingBlas, AZ::RHI::RayTracingBufferPools, AZ::RHI::RayTracingCompactionQuery, AZ::RHI::RayTracingCompactionQueryPool, AZ::RHI::RayTracingPipelineState, AZ::RHI::RayTracingShaderTable, AZ::RHI::RayTracingTlas, AZ::RHI::Resource, AZ::RHI::ResourcePool, and AZ::RHI::TransientAttachmentPool.
|
| 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 |
|
| 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.
|
|
|
template<typename T > |
static AZ_FORCE_INLINE void | IterateDevices (MultiDevice::DeviceMask deviceMask, T callback) |
|
|
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 > |
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 |
|
void | add_ref () const |
|
void | release () const |
|
|
AZStd::unordered_map< int, Ptr< DeviceObject > > | m_deviceObjects |
| A map of all device-specific objects, indexed by the device index.
|
|
AZStd::atomic_int | m_useCount = 0 |
|
A variant of Object associated with a DeviceMask. In contrast to DeviceObject, which is device-specific and holds a strong reference to a specific device, MultiDeviceObject only specifies on which device an object resides/operates, specified by a DeviceMask (1 bit per device).
◆ GetDeviceMask()
MultiDevice::DeviceMask AZ::RHI::MultiDeviceObject::GetDeviceMask |
( |
| ) |
const |
Returns the device this object is associated with. It is only permitted to call this method when the object is initialized.
◆ IsDeviceSet()
AZ_FORCE_INLINE bool AZ::RHI::MultiDeviceObject::IsDeviceSet |
( |
int |
deviceIndex | ) |
const |
|
inline |
Helper method to check if a device index is set in the device mask. Note: A bit may be set but a device object may not actually exist, e.g. if the device index is bigger than the device count.
◆ IterateDevices()
template<typename T >
static AZ_FORCE_INLINE void AZ::RHI::MultiDeviceObject::IterateDevices |
( |
MultiDevice::DeviceMask |
deviceMask, |
|
|
T |
callback |
|
) |
| |
|
inlinestatic |
Helper method that will iterate over all available devices in a device mask and call the provided callback The callback is called with the device index and needs to return a boolean indicating whether to continue th iteration.
◆ IterateObjects()
template<typename T , typename U >
AZ_FORCE_INLINE decltype(auto) AZ::RHI::MultiDeviceObject::IterateObjects |
( |
U |
callback | ) |
|
|
inlineprotected |
Helper method that will iterate over all device objects and call the provided callback with a device index and the object expecting ResultCode::Success in order to continue the iteration
◆ Shutdown()
void AZ::RHI::MultiDeviceObject::Shutdown |
( |
| ) |
|
|
overrideprotectedvirtual |
The documentation for this class was generated from the following file:
- Gems/Atom/RHI/Code/Include/Atom/RHI/MultiDeviceObject.h