Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::IDeviceObject Struct Referenceabstract

Base interface for all objects created by the render device Diligent::IRenderDevice. More...

#include <DeviceObject.h>

Inheritance diagram for Diligent::IDeviceObject:
Diligent.IObject Diligent::RefCountedObject< IDeviceObject > Diligent::IBottomLevelAS Diligent::IBuffer Diligent::IBufferView Diligent::ICommandList Diligent::IDeviceMemory Diligent::IFence Diligent::IFramebuffer Diligent::IPipelineResourceSignature Diligent::IPipelineState Diligent::IPipelineStateCache Diligent.IQuery Diligent::IRasterizationRateMapMtl Diligent::IRenderPass Diligent::ISampler Diligent.IShader Diligent.IShaderBindingTable Diligent::ITexture Diligent::ITextureView Diligent::ITopLevelAS

Public Member Functions

virtual const DeviceObjectAttribs &DILIGENT_CALL_TYPE GetDesc () const =0
 Returns the object description.
 
virtual Int32 DILIGENT_CALL_TYPE GetUniqueID () const =0
 Returns unique identifier assigned to an object.
 
virtual void DILIGENT_CALL_TYPE SetUserData (IObject *pUserData)=0
 Stores a pointer to the user-provided data object.
 
virtual IObject *DILIGENT_CALL_TYPE GetUserData () const =0
 Returns a pointer to the user data object previously set with SetUserData() method.
 
- Public Member Functions inherited from Diligent.IObject
virtual void DILIGENT_CALL_TYPE QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0
 Queries the specific interface.
 
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE AddRef ()=0
 Increments the number of strong references by 1.
 
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE Release ()=0
 
virtual IReferenceCounters *DILIGENT_CALL_TYPE GetReferenceCounters () const =0
 

Detailed Description

Base interface for all objects created by the render device Diligent::IRenderDevice.

Member Function Documentation

◆ GetUniqueID()

virtual Int32 DILIGENT_CALL_TYPE Diligent::IDeviceObject::GetUniqueID ( ) const
pure virtual

Returns unique identifier assigned to an object.

Unique identifiers can be used to reliably check if two objects are identical. Note that the engine reuses memory reclaimed after an object has been released. For example, if a texture object is released and then another texture is created, the engine may return the same pointer, so pointer-to-pointer comparisons are not reliable. Unique identifiers, on the other hand, are guaranteed to be, well, unique.

Unique identifiers are object-specifics, so, for instance, buffer identifiers are not comparable to texture identifiers.

Unique identifiers are only meaningful within one session. After an application restarts, all identifiers become invalid.

Valid identifiers are always positive values. Zero and negative values can never be assigned to an object and are always guaranteed to be invalid.

Implemented in Diligent::DeviceObjectBase< IDeviceObject, RenderDeviceVkImpl, DeviceObjectAttribs >, and Diligent::DeviceObjectBase< IDeviceObject, RenderDeviceVkImpl, DeviceObjectAttribs >.

◆ GetUserData()

virtual IObject *DILIGENT_CALL_TYPE Diligent::IDeviceObject::GetUserData ( ) const
pure virtual

Returns a pointer to the user data object previously set with SetUserData() method.

Returns
The pointer to the user data object.
Remarks
The method does NOT call AddRef() for the object being returned.

Implemented in Diligent::DeviceObjectBase< IDeviceObject, RenderDeviceVkImpl, DeviceObjectAttribs >, and Diligent::DeviceObjectBase< IDeviceObject, RenderDeviceVkImpl, DeviceObjectAttribs >.

◆ SetUserData()

virtual void DILIGENT_CALL_TYPE Diligent::IDeviceObject::SetUserData ( IObject * pUserData)
pure virtual

Stores a pointer to the user-provided data object.

The data may later be retrieved through GetUserData().

Parameters
[in]pUserData- Pointer to the user data object to store.
Note
The method is not thread-safe and an application must externally synchronize the access.

The method keeps strong reference to the user data object. If an application needs to release the object, it should call SetUserData(nullptr);

Implemented in Diligent::DeviceObjectBase< IDeviceObject, RenderDeviceVkImpl, DeviceObjectAttribs >, and Diligent::DeviceObjectBase< IDeviceObject, RenderDeviceVkImpl, DeviceObjectAttribs >.