Vulkan SDK for Android 1.1.1 Mali Developer Center
MaliSDK::FenceManager Class Reference

The FenceManager keeps track of fences which in turn are used to keep track of GPU progress. More...

#include <fence_manager.hpp>

Public Member Functions

 FenceManager (VkDevice device)
 Constructor. More...
 
 ~FenceManager ()
 Destructor.
 
void beginFrame ()
 Begins the frame. Waits for GPU to trigger all outstanding fences. After begin frame returns, it is safe to reuse or delete resources which were used previously. More...
 
VkFence requestClearedFence ()
 Called internally by the Context whenever submissions to GPU happens.
 
unsigned getActiveFenceCount () const
 Gets the number of fences which are inFlight on the GPU. More...
 
VkFence * getActiveFences ()
 Gets an array for the fences which are inFlight on the GPU. More...
 

Detailed Description

The FenceManager keeps track of fences which in turn are used to keep track of GPU progress.

Whenever we submit work to the GPU, it is our responsibility to make sure that the GPU is done using our resources before we modify or delete them. To implement this, we therefore use VkFences to keep track of all vkQueueSubmits.

Definition at line 37 of file fence_manager.hpp.

Constructor & Destructor Documentation

◆ FenceManager()

MaliSDK::FenceManager::FenceManager ( VkDevice  device)

Constructor.

Parameters
deviceThe Vulkan device

Definition at line 25 of file fence_manager.cpp.

Member Function Documentation

◆ beginFrame()

void MaliSDK::FenceManager::beginFrame ( )

Begins the frame. Waits for GPU to trigger all outstanding fences. After begin frame returns, it is safe to reuse or delete resources which were used previously.

We wait for fences which completes N frames earlier, so we do not stall, waiting for all GPU work to complete before this returns.

Definition at line 38 of file fence_manager.cpp.

◆ getActiveFenceCount()

unsigned MaliSDK::FenceManager::getActiveFenceCount ( ) const
inline

Gets the number of fences which are inFlight on the GPU.

Returns
The number of fences which can be waited for.

Definition at line 62 of file fence_manager.hpp.

◆ getActiveFences()

VkFence* MaliSDK::FenceManager::getActiveFences ( )
inline

Gets an array for the fences which are inFlight on the GPU.

Returns
Array of waitable fences. Call getActiveFenceCount for the number of fences.

Definition at line 70 of file fence_manager.hpp.


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