Fence interface. More...
#include <Fence.h>
Public Member Functions | |
| virtual const FenceDesc &DILIGENT_CALL_TYPE | GetDesc () const override=0 |
| Returns the fence description used to create the object. | |
| virtual Uint64 DILIGENT_CALL_TYPE | GetCompletedValue ()=0 |
| Returns the last completed value signaled by the GPU. | |
| virtual void DILIGENT_CALL_TYPE | Signal (Uint64 Value)=0 |
| Sets the fence to the specified value. | |
| virtual void DILIGENT_CALL_TYPE | Wait (Uint64 Value)=0 |
| Waits until the fence reaches or exceeds the specified value, on the host. | |
| Public Member Functions inherited from Diligent::IDeviceObject | |
| virtual Int32 DILIGENT_CALL_TYPE | GetUniqueID () const =0 |
| Returns unique identifier assigned to an object. | |
| virtual void DILIGENT_CALL_TYPE | SetUserData (IObject *pUserData)=0 |
| Stores a pointer to the user-provided data object. | |
| virtual IObject *DILIGENT_CALL_TYPE | GetUserData () const =0 |
| Returns a pointer to the user data object previously set with SetUserData() method. | |
| Public Member Functions inherited from Diligent.IObject | |
| virtual void DILIGENT_CALL_TYPE | QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0 |
| Queries the specific interface. | |
| template<typename DerivedType, typename = typename std::enable_if<std::is_base_of<IObject, DerivedType>::value>::type> | |
| void | QueryInterface (const INTERFACE_ID &IID, DerivedType **ppInterface) |
| virtual ReferenceCounterValueType DILIGENT_CALL_TYPE | AddRef ()=0 |
| Increments the number of strong references by 1. | |
| virtual ReferenceCounterValueType DILIGENT_CALL_TYPE | Release ()=0 |
| virtual IReferenceCounters *DILIGENT_CALL_TYPE | GetReferenceCounters () const =0 |
Fence interface.
Defines the methods to manipulate a fence object
When a fence that was previously signaled by IDeviceContext::EnqueueSignal() is destroyed, it may block the GPU until all prior commands have completed execution.
|
pure virtual |
Returns the last completed value signaled by the GPU.
|
pure virtual |
Sets the fence to the specified value.
| [in] | Value | - New value to set the fence to. The value must be greater than the current value of the fence. |
Fence value will be changed immediately on the CPU. Use IDeviceContext::EnqueueSignal to enqueue a signal command that will change the value on the GPU after all previously submitted commands are complete.
|
pure virtual |
Waits until the fence reaches or exceeds the specified value, on the host.
| [in] | Value | - The value that the fence is waiting for to reach. |
The call normally blocks until the fence reaches Value.
On browser WebGPU, this method requires Asyncify or JSPI. If neither is enabled, it logs an error and returns without waiting. With JSPI, call through a suspension-capable WebAssembly entry point (such as an export wrapped with WebAssembly.promising). A synchronous frame callback can throw WebAssembly.SuspendError if the wait needs to yield. In a synchronous frame callback, poll IFence::GetCompletedValue() on later frames until it reaches or exceeds Value.
A suspended wait yields to the browser event loop. Until the call returns, defer application callbacks that reenter the same operation or modify resources it uses.