2#include "../foray_basics.hpp"
3#include "../foray_vulkan.hpp"
4#include <unordered_set>
5#include <spdlog/spdlog.h>
13 static inline std::unordered_set<ManagedResource*> sAllocatedRessources{};
42 virtual void SetName(std::string_view name);
57 template <VkObjectType OBJECT_TYPE>
76 template <VkObjectType OBJECT_TYPE>
82 template <VkObjectType OBJECT_TYPE>
88 if(updateResourceName)
Simple types for supressing automatic definition of duplicating move constructors & operator.
Definition foray_basics.hpp:19
Base class enforcing common interface for all classes wrapping a device resource.
Definition foray_managedresource.hpp:11
virtual void Destroy()=0
Destroy the resource.
virtual ~ManagedResource()
Unregisters the resource.
ManagedResource(std::string_view name)
Registers the resource and sets its name.
virtual bool Exists() const =0
Return true, if the managed resource is allocated.
std::string Print() const
Print name and type in one string.
static void sPrintAllocatedResources(bool printAsWarning)
Print a list of all registered existing resources.
static const std::unordered_set< ManagedResource * > * GetTotalAllocatedResources()
Definition foray_managedresource.hpp:19
std::string mName
This objects custom name.
Definition foray_managedresource.hpp:49
virtual std::string_view GetTypeName() const
Return a hint for the type of resource managed by the instantiation.
virtual void SetName(std::string_view name)
Set a custom name for the object.
ManagedResource()
Default constructor registers the resource.
std::string_view GetName() const
Return a custom name for the object.
Definition foray_managedresource.hpp:40
ManagedResource variant which automates GetTypeName() overloading by returning a stringified version ...
Definition foray_managedresource.hpp:59
virtual std::string_view GetTypeName() const
Returns <OBJECT_TYPE> stringified.
Definition foray_managedresource.hpp:77
VulkanResource(std::string_view name)
Definition foray_managedresource.hpp:62
virtual void SetObjectName(core::Context *context, const void *handle, std::string_view name, bool updateResourceName=true)
Set the object name. Sets both ManagedResource::mName aswell as vulkan debug object name.
Definition foray_managedresource.hpp:83
VulkanResource()
Definition foray_managedresource.hpp:61
Definition foray_commandbuffer.hpp:6
std::string_view PrintVkObjectType(VkObjectType objecType)
Uses nameof.hpp's NAMEOF_ENUM function to stringify VkObjectType.
void SetVulkanObjectName(core::Context *context, VkObjectType objectType, const void *objectHandle, std::string_view name)
Set a vulkan object name (Will show up in validation errors, NSight, RenderDoc, .....
Non owning context object.
Definition foray_context.hpp:16