|
CeresEngine 0.2.0
A game development framework
|
A object that caches existing Vulkan objects. More...
#include <CeresEngine/RenderAPI/Vulkan/VKCommon.hpp>
Public Types | |
| using | Descriptor = DescriptorType |
| The type of descriptor used to detect duplicates and create new objects. | |
| using | Object = ObjectType |
| The type of object managed by the cache object. | |
| using | ObjectPtr = RC< Object > |
| A pointer to the cached object. | |
Public Member Functions | |
| VKObjectCache (OwnerType &owner) | |
| Creates a new Vulkan device object cache for the given device. | |
| ~VKObjectCache () | |
| Destroys the Vulkan device object cache. | |
| ObjectPtr | get (const Descriptor &descriptor) |
Searches for an existing object that is compatible with the given descriptor. | |
| ObjectPtr | operator[] (const Descriptor &descriptor) |
Searches for an existing object that is compatible with the given descriptor. | |
| void | release (Object *object) |
| Releases a previously cached object. | |
Private Attributes | |
| OwnerType & | mOwner |
| The object owning the cached objects. | |
| HashMap< UInt64, Object * > | mCache |
| A map that contains all cached objects. | |
A object that caches existing Vulkan objects.
Stateless objects can be shared across the engine.
| ObjectType | The type of object managed by the cache object. |
| OwnerType | The type of the object owner. |
| using CeresEngine::VKObjectCache< ObjectType, OwnerType, DescriptorType >::Descriptor = DescriptorType |
The type of descriptor used to detect duplicates and create new objects.
| using CeresEngine::VKObjectCache< ObjectType, OwnerType, DescriptorType >::Object = ObjectType |
The type of object managed by the cache object.
| using CeresEngine::VKObjectCache< ObjectType, OwnerType, DescriptorType >::ObjectPtr = RC<Object> |
A pointer to the cached object.
|
explicit |
Creates a new Vulkan device object cache for the given device.
| owner | The device to create new objects for. |
| CeresEngine::VKObjectCache< ObjectType, OwnerType, DescriptorType >::~VKObjectCache | ( | ) |
Destroys the Vulkan device object cache.
| ObjectPtr CeresEngine::VKObjectCache< ObjectType, OwnerType, DescriptorType >::get | ( | const Descriptor & | descriptor | ) |
Searches for an existing object that is compatible with the given descriptor.
If none is found, a new one is created and returned.
| descriptor | The descriptor to lookup/create a new object from. |
|
inline |
Searches for an existing object that is compatible with the given descriptor.
If none is found, a new one is created and returned.
| descriptor | The descriptor to lookup/create a new object from. |
| void CeresEngine::VKObjectCache< ObjectType, OwnerType, DescriptorType >::release | ( | Object * | object | ) |
Releases a previously cached object.
|
private |
A map that contains all cached objects.
|
private |
The object owning the cached objects.