Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
foray::util::ManagedUbo< T_UBO > Class Template Reference

Template class for managing a UBO. For Host -> Device synchronization this utilises a DualBuffer. More...

#include <foray_managedubo.hpp>

Inheritance diagram for foray::util::ManagedUbo< T_UBO >:
foray::util::ManagedUboBase foray::core::ManagedResource foray::NoMoveDefaults

Public Member Functions

 ManagedUbo ()
 
 ~ManagedUbo ()
 
void Create (core::Context *context, std::string_view name)
 
virtual void UpdateTo (uint32_t frameIndex) override
 
- Public Member Functions inherited from foray::util::ManagedUboBase
size_t SizeOfUbo () const
 
virtual void CmdCopyToDevice (uint32_t frameIndex, VkCommandBuffer cmdBuffer)
 
virtual void CmdPrepareForRead (VkCommandBuffer cmdBuffer, VkPipelineStageFlags2 dstStageMask, VkAccessFlags2 dstAccessMask) const
 
virtual VkBufferMemoryBarrier2 MakeBarrierPrepareForRead (VkPipelineStageFlags2 dstStageMask, VkAccessFlags2 dstAccessMask) const
 
void Create (core::Context *context, VkDeviceSize size, uint32_t stageBufferCount=INFLIGHT_FRAME_COUNT)
 
virtual bool Exists () const override
 Return true, if the managed resource is allocated.
 
virtual void Destroy () override
 Destroy the resource.
 
const core::ManagedBufferGetDeviceBuffer () const
 
 operator VkBuffer () const
 
VkDescriptorBufferInfo GetVkDescriptorBufferInfo () const
 
VkBuffer GetVkBuffer () const
 
- Public Member Functions inherited from foray::core::ManagedResource
virtual std::string_view GetTypeName () const
 Return a hint for the type of resource managed by the instantiation.
 
 ManagedResource ()
 Default constructor registers the resource.
 
 ManagedResource (std::string_view name)
 Registers the resource and sets its name.
 
virtual ~ManagedResource ()
 Unregisters the resource.
 
std::string_view GetName () const
 Return a custom name for the object.
 
virtual void SetName (std::string_view name)
 Set a custom name for the object.
 
std::string Print () const
 Print name and type in one string.
 
- Public Member Functions inherited from foray::NoMoveDefaults
 NoMoveDefaults ()=default
 
 NoMoveDefaults (const NoMoveDefaults &other)=delete
 
 NoMoveDefaults (NoMoveDefaults &&other)=default
 
NoMoveDefaultsoperator= (const NoMoveDefaults &other)=delete
 

Protected Attributes

T_UBO mData
 
- Protected Attributes inherited from foray::util::ManagedUboBase
DualBuffer mUboBuffer
 
- Protected Attributes inherited from foray::core::ManagedResource
std::string mName
 This objects custom name.
 

Additional Inherited Members

- Static Public Member Functions inherited from foray::core::ManagedResource
static void sPrintAllocatedResources (bool printAsWarning)
 Print a list of all registered existing resources.
 
static const std::unordered_set< ManagedResource * > * GetTotalAllocatedResources ()
 

Detailed Description

template<typename T_UBO>
class foray::util::ManagedUbo< T_UBO >

Template class for managing a UBO. For Host -> Device synchronization this utilises a DualBuffer.

Usage

Constructor & Destructor Documentation

◆ ManagedUbo()

template<typename T_UBO >
foray::util::ManagedUbo< T_UBO >::ManagedUbo ( )
inline

◆ ~ManagedUbo()

template<typename T_UBO >
foray::util::ManagedUbo< T_UBO >::~ManagedUbo ( )
inline

Member Function Documentation

◆ Create()

template<typename T_UBO >
void foray::util::ManagedUbo< T_UBO >::Create ( core::Context context,
std::string_view  name 
)
inline

◆ UpdateTo()

template<typename T_UBO >
void foray::util::ManagedUbo< T_UBO >::UpdateTo ( uint32_t  frameIndex)
inlineoverridevirtual

Member Data Documentation

◆ mData

template<typename T_UBO >
T_UBO foray::util::ManagedUbo< T_UBO >::mData
protected

The documentation for this class was generated from the following file: