From 5c7f9cc49e2c7e4986003e50dafceeb00420e61f Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Fri, 8 Nov 2019 10:08:20 -0800 Subject: Added IDeviceObject::GetUniqueID method (API Version 240039) --- Graphics/GraphicsEngine/include/DeviceObjectBase.h | 2 +- Graphics/GraphicsEngine/interface/APIInfo.h | 2 +- Graphics/GraphicsEngine/interface/DeviceObject.h | 22 +++++++++++++++++++++- Graphics/GraphicsEngine/interface/Texture.h | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/include/DeviceObjectBase.h b/Graphics/GraphicsEngine/include/DeviceObjectBase.h index f1e8e0b0..44011d8c 100644 --- a/Graphics/GraphicsEngine/include/DeviceObjectBase.h +++ b/Graphics/GraphicsEngine/include/DeviceObjectBase.h @@ -136,7 +136,7 @@ public: } /// Returns unique identifier - UniqueIdentifier GetUniqueID()const + virtual Int32 GetUniqueID()const override final { /// \note /// This unique ID is used to unambiguously identify device object for diff --git a/Graphics/GraphicsEngine/interface/APIInfo.h b/Graphics/GraphicsEngine/interface/APIInfo.h index 298b84c5..70de6f5a 100644 --- a/Graphics/GraphicsEngine/interface/APIInfo.h +++ b/Graphics/GraphicsEngine/interface/APIInfo.h @@ -26,7 +26,7 @@ /// \file /// Diligent API information -#define DILIGENT_API_VERSION 240038 +#define DILIGENT_API_VERSION 240039 #include "../../../Primitives/interface/BasicTypes.h" diff --git a/Graphics/GraphicsEngine/interface/DeviceObject.h b/Graphics/GraphicsEngine/interface/DeviceObject.h index bd7e8c61..1d175cf5 100644 --- a/Graphics/GraphicsEngine/interface/DeviceObject.h +++ b/Graphics/GraphicsEngine/interface/DeviceObject.h @@ -43,8 +43,28 @@ public: /// Queries the specific interface, see IObject::QueryInterface() for details virtual void QueryInterface( const INTERFACE_ID& IID, IObject** ppInterface )override = 0; - /// Returns the buffer object description + + /// Returns the object description virtual const DeviceObjectAttribs& GetDesc()const = 0; + + + /// Returns unique identifier assigned to an object + + /// \remarks Unique identifiers can be used to reliably check if two objects are identical. + /// Note that the engine resuses 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. + virtual Int32 GetUniqueID() const = 0; }; } diff --git a/Graphics/GraphicsEngine/interface/Texture.h b/Graphics/GraphicsEngine/interface/Texture.h index 6e328f83..cc5a1ebe 100644 --- a/Graphics/GraphicsEngine/interface/Texture.h +++ b/Graphics/GraphicsEngine/interface/Texture.h @@ -106,7 +106,7 @@ struct TextureDesc : DeviceObjectAttribs TEXTURE_FORMAT Format = TEX_FORMAT_UNKNOWN; /// Number of Mip levels in the texture. Multisampled textures can only have 1 Mip level. - /// Specify 0 to generate full mipmap chain. + /// Specify 0 to create full mipmap chain. Uint32 MipLevels = 1; /// Number of samples.\n -- cgit v1.2.3