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::HostSyncCommandBuffer Class Reference

Extension of the commandbuffer wrapper for temporary host synchronized command buffer execution. More...

#include <foray_commandbuffer.hpp>

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

Public Member Functions

virtual VkCommandBuffer Create (Context *context, VkCommandBufferLevel cmdBufferLvl=VK_COMMAND_BUFFER_LEVEL_PRIMARY, bool begin=false) override
 Create based on the contexts device, command pool and queue.
 
void Submit ()
 Submits but doesn't synchronize. Use HasCompleted() and/or WaitForCompletion() to synchronize.
 
void SubmitAndWait ()
 Submits and waits for the commandbuffer to be completed.
 
bool HasCompleted ()
 Checks the fence for completion (non-blocking)
 
void WaitForCompletion ()
 Blocks CPU thread until commandbuffer has completed.
 
virtual void Destroy () override
 Destroys the associated resources.
 
virtual ~HostSyncCommandBuffer ()
 
- Public Member Functions inherited from foray::core::CommandBuffer
 CommandBuffer ()=default
 
virtual ~CommandBuffer ()
 
virtual void Begin ()
 vkBeginCommandBuffer();
 
virtual void End ()
 vkEndCommandBuffer()
 
virtual void Reset (VkCommandBufferResetFlags flags=0)
 vkResetCommandBuffer()
 
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

VkFence mFence = nullptr
 
- Protected Attributes inherited from foray::core::CommandBuffer
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

Extension of the commandbuffer wrapper for temporary host synchronized command buffer execution.

Constructor & Destructor Documentation

◆ ~HostSyncCommandBuffer()

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

Member Function Documentation

◆ Create()

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

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

Reimplemented from foray::core::CommandBuffer.

◆ Destroy()

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

Destroys the associated resources.

Reimplemented from foray::core::CommandBuffer.

◆ HasCompleted()

bool foray::core::HostSyncCommandBuffer::HasCompleted ( )

Checks the fence for completion (non-blocking)

◆ Submit()

void foray::core::HostSyncCommandBuffer::Submit ( )

Submits but doesn't synchronize. Use HasCompleted() and/or WaitForCompletion() to synchronize.

◆ SubmitAndWait()

void foray::core::HostSyncCommandBuffer::SubmitAndWait ( )

Submits and waits for the commandbuffer to be completed.

◆ WaitForCompletion()

void foray::core::HostSyncCommandBuffer::WaitForCompletion ( )

Blocks CPU thread until commandbuffer has completed.

Member Data Documentation

◆ mFence

VkFence foray::core::HostSyncCommandBuffer::mFence = nullptr
protected

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