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::core::CommandBuffer Class Reference

VkCommandBuffer wrapper. More...

#include <foray_commandbuffer.hpp>

Inheritance diagram for foray::core::CommandBuffer:
foray::core::VulkanResource< VkObjectType::VK_OBJECT_TYPE_COMMAND_BUFFER > foray::core::ManagedResource foray::NoMoveDefaults foray::core::DeviceSyncCommandBuffer foray::core::HostSyncCommandBuffer

Public Member Functions

 CommandBuffer ()=default
 
virtual ~CommandBuffer ()
 
virtual VkCommandBuffer Create (Context *context, VkCommandBufferLevel cmdBufferLvl=VK_COMMAND_BUFFER_LEVEL_PRIMARY, bool begin=false)
 Create based on the contexts device, command pool and queue.
 
virtual void Begin ()
 vkBeginCommandBuffer();
 
virtual void End ()
 vkEndCommandBuffer()
 
virtual void Reset (VkCommandBufferResetFlags flags=0)
 vkResetCommandBuffer()
 
virtual void Destroy () override
 Destroys the associated resources.
 
virtual bool Exists () const override
 Return true, if the managed resource is allocated.
 
virtual void SetName (std::string_view name) override
 Set a custom name for the object.
 
 operator VkCommandBuffer () const
 
- Public Member Functions inherited from foray::core::VulkanResource< VkObjectType::VK_OBJECT_TYPE_COMMAND_BUFFER >
 VulkanResource ()
 
 VulkanResource (std::string_view name)
 
virtual std::string_view GetTypeName () const
 Returns <OBJECT_TYPE> stringified.
 
- Public Member Functions inherited from foray::core::ManagedResource
 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.
 
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

core::ContextmContext = nullptr
 
VkCommandBuffer mCommandBuffer {}
 
bool mIsRecording = false
 
- 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 ()
 
- Protected Member Functions inherited from foray::core::VulkanResource< VkObjectType::VK_OBJECT_TYPE_COMMAND_BUFFER >
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.
 

Detailed Description

VkCommandBuffer wrapper.

Constructor & Destructor Documentation

◆ CommandBuffer()

foray::core::CommandBuffer::CommandBuffer ( )
default

◆ ~CommandBuffer()

virtual foray::core::CommandBuffer::~CommandBuffer ( )
inlinevirtual

Member Function Documentation

◆ Begin()

virtual void foray::core::CommandBuffer::Begin ( )
virtual

vkBeginCommandBuffer();

◆ Create()

virtual VkCommandBuffer foray::core::CommandBuffer::Create ( Context context,
VkCommandBufferLevel  cmdBufferLvl = VK_COMMAND_BUFFER_LEVEL_PRIMARY,
bool  begin = false 
)
virtual

Create based on the contexts device, command pool and queue.

Reimplemented in foray::core::HostSyncCommandBuffer.

◆ Destroy()

virtual void foray::core::CommandBuffer::Destroy ( )
overridevirtual

Destroys the associated resources.

Implements foray::core::ManagedResource.

Reimplemented in foray::core::HostSyncCommandBuffer.

◆ End()

virtual void foray::core::CommandBuffer::End ( )
virtual

vkEndCommandBuffer()

◆ Exists()

virtual bool foray::core::CommandBuffer::Exists ( ) const
inlineoverridevirtual

Return true, if the managed resource is allocated.

Example: Vulkan object stored could be nullptr or instantiated

Implements foray::core::ManagedResource.

◆ operator VkCommandBuffer()

foray::core::CommandBuffer::operator VkCommandBuffer ( ) const
inline

◆ Reset()

virtual void foray::core::CommandBuffer::Reset ( VkCommandBufferResetFlags  flags = 0)
virtual

vkResetCommandBuffer()

◆ SetName()

virtual void foray::core::CommandBuffer::SetName ( std::string_view  name)
overridevirtual

Set a custom name for the object.

Reimplemented from foray::core::ManagedResource.

Member Data Documentation

◆ mCommandBuffer

VkCommandBuffer foray::core::CommandBuffer::mCommandBuffer {}
protected

◆ mContext

core::Context* foray::core::CommandBuffer::mContext = nullptr
protected

◆ mIsRecording

bool foray::core::CommandBuffer::mIsRecording = false
protected

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