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::ManagedUboBase Class Referenceabstract

#include <foray_managedubo.hpp>

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

Public Member Functions

size_t SizeOfUbo () const
 
virtual void UpdateTo (uint32_t frameIndex)=0
 
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

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 ()
 

Member Function Documentation

◆ CmdCopyToDevice()

virtual void foray::util::ManagedUboBase::CmdCopyToDevice ( uint32_t  frameIndex,
VkCommandBuffer  cmdBuffer 
)
virtual

◆ CmdPrepareForRead()

virtual void foray::util::ManagedUboBase::CmdPrepareForRead ( VkCommandBuffer  cmdBuffer,
VkPipelineStageFlags2  dstStageMask,
VkAccessFlags2  dstAccessMask 
) const
virtual

◆ Create()

void foray::util::ManagedUboBase::Create ( core::Context context,
VkDeviceSize  size,
uint32_t  stageBufferCount = INFLIGHT_FRAME_COUNT 
)

◆ Destroy()

virtual void foray::util::ManagedUboBase::Destroy ( )
overridevirtual

Destroy the resource.

Remarks
This method must be callable even if the resource has not been initialized yet. This method must call any Destroy() overloads of child objects and of base classes

Implements foray::core::ManagedResource.

◆ Exists()

virtual bool foray::util::ManagedUboBase::Exists ( ) const
overridevirtual

Return true, if the managed resource is allocated.

Example: Vulkan object stored could be nullptr or instantiated

Implements foray::core::ManagedResource.

◆ GetDeviceBuffer()

const core::ManagedBuffer * foray::util::ManagedUboBase::GetDeviceBuffer ( ) const
inline

◆ GetVkBuffer()

VkBuffer foray::util::ManagedUboBase::GetVkBuffer ( ) const
inline

◆ GetVkDescriptorBufferInfo()

VkDescriptorBufferInfo foray::util::ManagedUboBase::GetVkDescriptorBufferInfo ( ) const

◆ MakeBarrierPrepareForRead()

virtual VkBufferMemoryBarrier2 foray::util::ManagedUboBase::MakeBarrierPrepareForRead ( VkPipelineStageFlags2  dstStageMask,
VkAccessFlags2  dstAccessMask 
) const
virtual

◆ operator VkBuffer()

foray::util::ManagedUboBase::operator VkBuffer ( ) const
inline

◆ SizeOfUbo()

size_t foray::util::ManagedUboBase::SizeOfUbo ( ) const
inline

◆ UpdateTo()

virtual void foray::util::ManagedUboBase::UpdateTo ( uint32_t  frameIndex)
pure virtual

Member Data Documentation

◆ mUboBuffer

DualBuffer foray::util::ManagedUboBase::mUboBuffer
protected

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