KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Karma::FVulkanFence Class Reference

Represents a Vulkan fence used for synchronization between the CPU and GPU. More...

#include <VulkanSynchronization.h>

Public Member Functions

 FVulkanFence (FVulkanDevice &InDevice, FVulkanFenceManager &InOwner, bool bCreateSignaled)
 Constructor for FVulkanFence.
bool IsSignaled () const
 Checks if the fence is currently signaled.
VkFence GetHandle () const
 Retrieves the Vulkan fence handle.

Protected Types

enum class  EState { NotReady , Signaled }

Protected Attributes

VkFence m_Handle
EState m_State
FVulkanFenceManager & m_Owner
friend FVulkanFenceManager

Detailed Description

Represents a Vulkan fence used for synchronization between the CPU and GPU.

A fence is a synchronization primitive that can be used to coordinate operations between the CPU and GPU. It allows the CPU to wait for the completion of GPU operations, ensuring that resources are not accessed prematurely.

Since
Karma 1.0.0

Member Enumeration Documentation

◆ EState

enum class Karma::FVulkanFence::EState
strongprotected
Enumerator
NotReady 

The fence is not signaled, initial state after reset.

Note
Fence must be signaled when created https://vulkan-tutorial.com/Drawing_a_triangle/Drawing/Rendering_and_presentation#page_Waiting-for-the-previous-frame
Signaled 

The fence is signaled, indicating that the associated operations have completed.

Note
vkWaitForFences will pass when fence is in this state

Constructor & Destructor Documentation

◆ FVulkanFence()

Karma::FVulkanFence::FVulkanFence ( FVulkanDevice & InDevice,
FVulkanFenceManager & InOwner,
bool bCreateSignaled )

Constructor for FVulkanFence.

Parameters
InDeviceReference to the owning FVulkanDevice
InOwnerReference to the owning FVulkanFenceManager
bCreateSignaledWhether to create the fence in a signaled state
Since
Karma 1.0.0

Member Function Documentation

◆ GetHandle()

VkFence Karma::FVulkanFence::GetHandle ( ) const
inline

Retrieves the Vulkan fence handle.

Returns
VkFence The Vulkan fence handle.
Since
Karma 1.0.0

◆ IsSignaled()

bool Karma::FVulkanFence::IsSignaled ( ) const
inline

Checks if the fence is currently signaled.

Returns
true if the fence is in the signaled state, false otherwise
Since
Karma 1.0.0

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