UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AndroidSwappyLoader.cpp File Reference
#include "AndroidSwappyLoader.h"
#include "swappy/swappyVk.h"
#include "swappy/swappyGL.h"
#include "swappy/swappyGL_extra.h"
#include <dlfcn.h>

Macros

#define APPLY_SWAPPY_FUNCTIONS(macro)
 
#define DECLARE_SWAPPY_FPTR(func)   typedef decltype(&func) FPTR_##func;
 
#define DEFINE_SWAPPY_FPTR(func)   FPTR_##func fp##func;
 
#define LOAD_SWAPPY_FPTR(func)
 
#define ZERO_SWAPPY_FPTR(func)   fp##func = 0;
 

Functions

void LoadSwappy ()
 
void UnloadSwappy ()
 
uint32_t Swappy_version ()
 
void Swappy_setThreadFunctions (const SwappyThreadFunctions *thread_functions)
 
const charSwappy_versionString ()
 
void SwappyVk_determineDeviceExtensions (VkPhysicalDevice physicalDevice, uint32_t availableExtensionCount, VkExtensionProperties *pAvailableExtensions, uint32_t *pRequiredExtensionCount, char **pRequiredExtensions)
 
void SwappyVk_setQueueFamilyIndex (VkDevice device, VkQueue queue, uint32_t queueFamilyIndex)
 
bool SwappyVk_initAndGetRefreshCycleDuration (JNIEnv *env, jobject jactivity, VkPhysicalDevice physicalDevice, VkDevice device, VkSwapchainKHR swapchain, uint64_t *pRefreshDuration)
 
void SwappyVk_setWindow (VkDevice device, VkSwapchainKHR swapchain, ANativeWindow *window)
 
void SwappyVk_setSwapIntervalNS (VkDevice device, VkSwapchainKHR swapchain, uint64_t swap_ns)
 
VkResult SwappyVk_queuePresent (VkQueue queue, const VkPresentInfoKHR *pPresentInfo)
 
void SwappyVk_destroySwapchain (VkDevice device, VkSwapchainKHR swapchain)
 
void SwappyVk_destroyDevice (VkDevice device)
 
void SwappyVk_setAutoSwapInterval (bool enabled)
 
void SwappyVk_setAutoPipelineMode (bool enabled)
 
void SwappyVk_setMaxAutoSwapIntervalNS (uint64_t max_swap_ns)
 
void SwappyVk_setFenceTimeoutNS (uint64_t fence_timeout_ns)
 
uint64_t SwappyVk_getFenceTimeoutNS ()
 
void SwappyVk_injectTracer (const SwappyTracer *tracer)
 
void SwappyVk_uninjectTracer (const SwappyTracer *tracer)
 
void SwappyVk_setFunctionProvider (const SwappyVkFunctionProvider *pSwappyVkFunctionProvider)
 
uint64_t SwappyVk_getSwapIntervalNS (VkSwapchainKHR swapchain)
 
int SwappyVk_getSupportedRefreshPeriodsNS (uint64_t *out_refreshrates, int allocated_entries, VkSwapchainKHR swapchain)
 
bool SwappyVk_isEnabled (VkSwapchainKHR swapchain, bool *isEnabled)
 
void SwappyVk_enableStats (VkSwapchainKHR swapchain, bool enabled)
 
void SwappyVk_recordFrameStart (VkQueue queue, VkSwapchainKHR swapchain, uint32_t image)
 
void SwappyVk_getStats (VkSwapchainKHR swapchain, SwappyStats *swappyStats)
 
void SwappyVk_clearStats (VkSwapchainKHR swapchain)
 
void SwappyVk_resetFramePacing (VkSwapchainKHR swapchain)
 
void SwappyVk_enableFramePacing (VkSwapchainKHR swapchain, bool enable)
 
void SwappyVk_enableBlockingWait (VkSwapchainKHR swapchain, bool enable)
 
bool SwappyGL_init (JNIEnv *env, jobject jactivity)
 
bool SwappyGL_isEnabled ()
 
void SwappyGL_destroy ()
 
bool SwappyGL_setWindow (ANativeWindow *window)
 
bool SwappyGL_swap (EGLDisplay display, EGLSurface surface)
 
void SwappyGL_setUseAffinity (bool tf)
 
void SwappyGL_setSwapIntervalNS (uint64_t swap_ns)
 
void SwappyGL_setFenceTimeoutNS (uint64_t fence_timeout_ns)
 
uint64_t SwappyGL_getRefreshPeriodNanos ()
 
uint64_t SwappyGL_getSwapIntervalNS ()
 
bool SwappyGL_getUseAffinity ()
 
uint64_t SwappyGL_getFenceTimeoutNS ()
 
void SwappyGL_setBufferStuffingFixWait (int32_t n_frames)
 
int SwappyGL_getSupportedRefreshPeriodsNS (uint64_t *out_refreshrates, int allocated_entries)
 
void SwappyGL_onChoreographer (int64_t frameTimeNanos)
 
void SwappyGL_injectTracer (const SwappyTracer *t)
 
void SwappyGL_setAutoSwapInterval (bool enabled)
 
void SwappyGL_setMaxAutoSwapIntervalNS (uint64_t max_swap_ns)
 
void SwappyGL_setAutoPipelineMode (bool enabled)
 
void SwappyGL_enableStats (bool enabled)
 
void SwappyGL_recordFrameStart (EGLDisplay display, EGLSurface surface)
 
void SwappyGL_getStats (SwappyStats *swappyStats)
 
void SwappyGL_uninjectTracer (const SwappyTracer *t)
 
void SwappyGL_clearStats ()
 
void SwappyGL_resetFramePacing ()
 
void SwappyGL_enableFramePacing (bool enable)
 
void SwappyGL_enableBlockingWait (bool enable)
 

Macro Definition Documentation

◆ APPLY_SWAPPY_FUNCTIONS

#define APPLY_SWAPPY_FUNCTIONS (   macro)

◆ DECLARE_SWAPPY_FPTR

#define DECLARE_SWAPPY_FPTR (   func)    typedef decltype(&func) FPTR_##func;

◆ DEFINE_SWAPPY_FPTR

#define DEFINE_SWAPPY_FPTR (   func)    FPTR_##func fp##func;

◆ LOAD_SWAPPY_FPTR

#define LOAD_SWAPPY_FPTR (   func)
Value:
fp##func = (FPTR_##func) dlsym(SwappyLibHandle, #func); \
if (!fp##func) { \
UE_LOG(LogAndroid, Log, TEXT("Failed to load Swappy function " #func)); \
}
#define TEXT(x)
Definition Platform.h:1272
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127

◆ ZERO_SWAPPY_FPTR

#define ZERO_SWAPPY_FPTR (   func)    fp##func = 0;

Function Documentation

◆ LoadSwappy()

void LoadSwappy ( )

◆ Swappy_setThreadFunctions()

void Swappy_setThreadFunctions ( const SwappyThreadFunctions thread_functions)

◆ Swappy_version()

uint32_t Swappy_version ( )

◆ Swappy_versionString()

const char * Swappy_versionString ( )

◆ SwappyGL_clearStats()

void SwappyGL_clearStats ( )

◆ SwappyGL_destroy()

void SwappyGL_destroy ( )

◆ SwappyGL_enableBlockingWait()

void SwappyGL_enableBlockingWait ( bool  enable)

◆ SwappyGL_enableFramePacing()

void SwappyGL_enableFramePacing ( bool  enable)

◆ SwappyGL_enableStats()

void SwappyGL_enableStats ( bool  enabled)

◆ SwappyGL_getFenceTimeoutNS()

uint64_t SwappyGL_getFenceTimeoutNS ( )

◆ SwappyGL_getRefreshPeriodNanos()

uint64_t SwappyGL_getRefreshPeriodNanos ( )

◆ SwappyGL_getStats()

void SwappyGL_getStats ( SwappyStats swappyStats)

◆ SwappyGL_getSupportedRefreshPeriodsNS()

int SwappyGL_getSupportedRefreshPeriodsNS ( uint64_t out_refreshrates,
int  allocated_entries 
)

◆ SwappyGL_getSwapIntervalNS()

uint64_t SwappyGL_getSwapIntervalNS ( )

◆ SwappyGL_getUseAffinity()

bool SwappyGL_getUseAffinity ( )

◆ SwappyGL_init()

bool SwappyGL_init ( JNIEnv env,
jobject  jactivity 
)

◆ SwappyGL_injectTracer()

void SwappyGL_injectTracer ( const SwappyTracer t)

◆ SwappyGL_isEnabled()

bool SwappyGL_isEnabled ( )

◆ SwappyGL_onChoreographer()

void SwappyGL_onChoreographer ( int64_t  frameTimeNanos)

◆ SwappyGL_recordFrameStart()

void SwappyGL_recordFrameStart ( EGLDisplay  display,
EGLSurface  surface 
)

◆ SwappyGL_resetFramePacing()

void SwappyGL_resetFramePacing ( )

◆ SwappyGL_setAutoPipelineMode()

void SwappyGL_setAutoPipelineMode ( bool  enabled)

◆ SwappyGL_setAutoSwapInterval()

void SwappyGL_setAutoSwapInterval ( bool  enabled)

◆ SwappyGL_setBufferStuffingFixWait()

void SwappyGL_setBufferStuffingFixWait ( int32_t  n_frames)

◆ SwappyGL_setFenceTimeoutNS()

void SwappyGL_setFenceTimeoutNS ( uint64_t  fence_timeout_ns)

◆ SwappyGL_setMaxAutoSwapIntervalNS()

void SwappyGL_setMaxAutoSwapIntervalNS ( uint64_t  max_swap_ns)

◆ SwappyGL_setSwapIntervalNS()

void SwappyGL_setSwapIntervalNS ( uint64_t  swap_ns)

◆ SwappyGL_setUseAffinity()

void SwappyGL_setUseAffinity ( bool  tf)

◆ SwappyGL_setWindow()

bool SwappyGL_setWindow ( ANativeWindow window)

◆ SwappyGL_swap()

bool SwappyGL_swap ( EGLDisplay  display,
EGLSurface  surface 
)

◆ SwappyGL_uninjectTracer()

void SwappyGL_uninjectTracer ( const SwappyTracer t)

◆ SwappyVk_clearStats()

void SwappyVk_clearStats ( VkSwapchainKHR  swapchain)

◆ SwappyVk_destroyDevice()

void SwappyVk_destroyDevice ( VkDevice  device)

◆ SwappyVk_destroySwapchain()

void SwappyVk_destroySwapchain ( VkDevice  device,
VkSwapchainKHR  swapchain 
)

◆ SwappyVk_determineDeviceExtensions()

void SwappyVk_determineDeviceExtensions ( VkPhysicalDevice  physicalDevice,
uint32_t  availableExtensionCount,
VkExtensionProperties pAvailableExtensions,
uint32_t pRequiredExtensionCount,
char **  pRequiredExtensions 
)

◆ SwappyVk_enableBlockingWait()

void SwappyVk_enableBlockingWait ( VkSwapchainKHR  swapchain,
bool  enable 
)

◆ SwappyVk_enableFramePacing()

void SwappyVk_enableFramePacing ( VkSwapchainKHR  swapchain,
bool  enable 
)

◆ SwappyVk_enableStats()

void SwappyVk_enableStats ( VkSwapchainKHR  swapchain,
bool  enabled 
)

◆ SwappyVk_getFenceTimeoutNS()

uint64_t SwappyVk_getFenceTimeoutNS ( )

◆ SwappyVk_getStats()

void SwappyVk_getStats ( VkSwapchainKHR  swapchain,
SwappyStats swappyStats 
)

◆ SwappyVk_getSupportedRefreshPeriodsNS()

int SwappyVk_getSupportedRefreshPeriodsNS ( uint64_t out_refreshrates,
int  allocated_entries,
VkSwapchainKHR  swapchain 
)

◆ SwappyVk_getSwapIntervalNS()

uint64_t SwappyVk_getSwapIntervalNS ( VkSwapchainKHR  swapchain)

◆ SwappyVk_initAndGetRefreshCycleDuration()

bool SwappyVk_initAndGetRefreshCycleDuration ( JNIEnv env,
jobject  jactivity,
VkPhysicalDevice  physicalDevice,
VkDevice  device,
VkSwapchainKHR  swapchain,
uint64_t pRefreshDuration 
)

◆ SwappyVk_injectTracer()

void SwappyVk_injectTracer ( const SwappyTracer tracer)

◆ SwappyVk_isEnabled()

bool SwappyVk_isEnabled ( VkSwapchainKHR  swapchain,
bool isEnabled 
)

◆ SwappyVk_queuePresent()

VkResult SwappyVk_queuePresent ( VkQueue  queue,
const VkPresentInfoKHR pPresentInfo 
)

◆ SwappyVk_recordFrameStart()

void SwappyVk_recordFrameStart ( VkQueue  queue,
VkSwapchainKHR  swapchain,
uint32_t  image 
)

◆ SwappyVk_resetFramePacing()

void SwappyVk_resetFramePacing ( VkSwapchainKHR  swapchain)

◆ SwappyVk_setAutoPipelineMode()

void SwappyVk_setAutoPipelineMode ( bool  enabled)

◆ SwappyVk_setAutoSwapInterval()

void SwappyVk_setAutoSwapInterval ( bool  enabled)

◆ SwappyVk_setFenceTimeoutNS()

void SwappyVk_setFenceTimeoutNS ( uint64_t  fence_timeout_ns)

◆ SwappyVk_setFunctionProvider()

void SwappyVk_setFunctionProvider ( const SwappyVkFunctionProvider pSwappyVkFunctionProvider)

◆ SwappyVk_setMaxAutoSwapIntervalNS()

void SwappyVk_setMaxAutoSwapIntervalNS ( uint64_t  max_swap_ns)

◆ SwappyVk_setQueueFamilyIndex()

void SwappyVk_setQueueFamilyIndex ( VkDevice  device,
VkQueue  queue,
uint32_t  queueFamilyIndex 
)

◆ SwappyVk_setSwapIntervalNS()

void SwappyVk_setSwapIntervalNS ( VkDevice  device,
VkSwapchainKHR  swapchain,
uint64_t  swap_ns 
)

◆ SwappyVk_setWindow()

void SwappyVk_setWindow ( VkDevice  device,
VkSwapchainKHR  swapchain,
ANativeWindow window 
)

◆ SwappyVk_uninjectTracer()

void SwappyVk_uninjectTracer ( const SwappyTracer tracer)

◆ UnloadSwappy()

void UnloadSwappy ( )