-
Notifications
You must be signed in to change notification settings - Fork 3
Description
I'm attempting to add support for anti-lag to a Vulkan renderer via VK_AMD_anti_lag. I'm not sure whether what I'm experiencing is a bug, or whether I'm misunderstanding what anti-lag actually does.
What I Expected
I call vkAntiLagUpdateAMD directly before polling for input, and again directly before my final queue submit. I have no FPS limit set, and I'm using the FIFO present mode.
I expected this to insert a sleep before polling for input as much as is reasonably possible without missing vblank, thereby reducing my input latency considerably since my frame only takes a couple hundred microseconds to finish on both the GPU and the CPU.
What Actually Happens
Neither call to vkAntiLagUpdateAMD blocks, or if they do they block very minimally. The call before update takes around 60us, the call before present takes around 1us. Instead, the application blocks in vkAcquireNextImage as it would without anti-lag wired up.
Strangely, If I enable the FPS limiter, and set it to limit to a rate lower than my refresh rate, then everything works as expected. My profiler shows the sleep being introduced where expected and my latency test app shows extremely low latency. Unfortunately this isn't a desirable configuration since it forces the game to miss vblank.
Possible User Error?
I was convinced this was a bug, so I implemented what appears to be the equivalent Nvidia feature (VK_NV_low_latency2) and got the exact same results with their API. I'm not really sure what to make of this.
Do I have incorrect expectations about what this feature actually does? Or maybe both of these features are using some heuristic that my app doesn't play nice with?