XII Release 0.1.0
Loading...
Searching...
No Matches
xiiGALFence Class Referenceabstract

Interface that defines methods to manipulate a fence object. More...

#include <Fence.h>

Inheritance diagram for xiiGALFence:
[legend]

Public Member Functions

XII_ALWAYS_INLINE const xiiGALFenceCreationDescriptionGetDescription () const
 This returns the creation description for this object.
 
virtual xiiUInt64 GetCompletedValue ()=0
 This returns the last completed value signaled by the GPU.
 
virtual void Signal (xiiUInt64 uiValue)=0
 This sets the fence to the specified value.
 
virtual void Wait (xiiUInt64 uiValue)=0
 This waits until the fence reaches or exceeds the specified value on the host.
 
void ValidateFenceSignal (xiiUInt64 uiValue)
 Validates fence signal.
 
void ValidateDeviceWaitForFence (xiiUInt64 uiValue)
 Validates device wait for fence.
 
- Public Member Functions inherited from xiiGALDeviceObject
XII_ALWAYS_INLINE xiiSharedPtr< xiiGALDeviceGetDevice () const
 Returns the xiiGALDevice that created this resource.
 
- Public Member Functions inherited from xiiGALObject
XII_ALWAYS_INLINE xiiStringView GetDebugName () const
 Returns the debug name of this resource.
 
void SetDebugName (xiiStringView sDebugName) const
 Sets the debug name for this resource.
 
- Public Member Functions inherited from xiiReflectedClass
virtual const xiiRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const xiiRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T>
XII_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
 
- Public Member Functions inherited from xiiRefCounted
virtual ~xiiRefCounted ()=default
 Adds a virtual destructor.
 
- Public Member Functions inherited from xiiRefCountingImpl
 xiiRefCountingImpl ()=default
 Constructor.
 
 xiiRefCountingImpl (const xiiRefCountingImpl &rhs)
 
void operator= (const xiiRefCountingImpl &rhs)
 
xiiUInt32 AddRef () const
 Increments the reference counter. Returns the new reference count.
 
xiiUInt32 ReleaseRef () const
 Decrements the reference counter. Returns the new reference count.
 
bool IsReferenced () const
 Returns true if the reference count is greater than 0, false otherwise.
 
xiiUInt32 GetRefCount () const
 Returns the current reference count.
 

Protected Member Functions

 xiiGALFence (xiiSharedPtr< xiiGALDevice > pDevice, const xiiGALFenceCreationDescription &creationDescription)
 
virtual xiiResult InitPlatform ()=0
 
void UpdateLastCompletedFenceValue (xiiUInt64 uiValue)
 
- Protected Member Functions inherited from xiiGALDeviceObject
 xiiGALDeviceObject (xiiSharedPtr< xiiGALDevice > pDevice)
 
- Protected Member Functions inherited from xiiGALObject
virtual XII_ALWAYS_INLINE void SetDebugNamePlatform (xiiStringView sName) const
 

Protected Attributes

xiiGALFenceCreationDescription m_Description
 
xiiAtomicIntegerU64 m_LastCompletedFenceValue
 
- Protected Attributes inherited from xiiGALDeviceObject
xiiSharedPtr< xiiGALDevicem_pDevice
 

Friends

class xiiGALDevice
 
class xiiMemoryUtils
 

Additional Inherited Members

- Static Public Member Functions inherited from xiiNoBase
static const xiiRTTIGetStaticRTTI ()
 

Detailed Description

Interface that defines methods to manipulate a fence object.

Remarks
When a fence that was previously signaled by IDeviceContext::EnqueueSignal() is destroyed, it may block the GPU until all prior commands have completed execution.
In Direct3D12 and Vulkan backends, fence is thread-safe.

Member Function Documentation

◆ GetCompletedValue()

virtual xiiUInt64 xiiGALFence::GetCompletedValue ( )
nodiscardpure virtual

This returns the last completed value signaled by the GPU.

Remarks
In Direct3D11 backend, this method is not thread-safe (even if the fence object is protected by a mutex) and must only be called by the same thread that signals the fence via an enqueue.

Implemented in xiiGALFenceVulkan.

◆ Signal()

virtual void xiiGALFence::Signal ( xiiUInt64 uiValue)
pure virtual

This sets the fence to the specified value.

Parameters
uiValue- The new value the fence should reach. The value must be greater than the current value of the fence.
Note
Fence value will be changed immediately on the CPU. Use device to enqueue a signal command that will change the value on the GPU after all previously submitted commands are complete.
The fence must have been created with type General.

Implemented in xiiGALFenceVulkan.

◆ ValidateDeviceWaitForFence()

void xiiGALFence::ValidateDeviceWaitForFence ( xiiUInt64 uiValue)

Validates device wait for fence.

Parameters
uiValue- The enqueued value.

◆ ValidateFenceSignal()

void xiiGALFence::ValidateFenceSignal ( xiiUInt64 uiValue)

Validates fence signal.

Parameters
uiValue- The enqueued value.

◆ Wait()

virtual void xiiGALFence::Wait ( xiiUInt64 uiValue)
pure virtual

This waits until the fence reaches or exceeds the specified value on the host.

Parameters
uiValue- The value that the fence is waiting to reach.
Note
The method blocks the execution of the calling thread until the wait is complete.

Implemented in xiiGALFenceVulkan.


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