using vkWaitForPresentKHR #1616
-
|
Hello, I am a longtime OSG user, considering the switch to VSG for about a week, i.e. almost no experience with VSG/Vulkan. I need to synchronise my program running on the CPU to exactly when the current frame is being presented on the display (as accurately as possible). I have 2 main purposes for this: reducing latency (i.e. wait as much as possible before sampling sensors and rendering) and controlling stereo shutter glasses "by hand" (i.e. I need to know when to shut the left eye and let the right eye be exposed when the right eye image is about to be presented). I've found the "VK_GOOGLE_display_timing" vulkan extension but it is not available on any of my vulkan implementations. So I am planning on using the "VK_KHR_present_wait" vulkan extensions (available on both MacOS/M4 and Linux/NVidia), but I am having troubles using them within the VSG workflow.
Of course, I may be completely off the mark. Any help will be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
I am not familiar with the extension a quick check on my Kubuntu 22.04 + Geforece 2060 shows that it's supported: $ vsgdeviceselection --extensions | grep VK_KHR_present_wait A quick search online for details on the vkWaitForPresentKHR extension: https://docs.vulkan.org/refpages/latest/refpages/source/vkWaitForPresentKHR.html As it's extension it'll need to be enabled why setting up the vsg/vkInstance and vsg/vkDevice, then have the functions called in the appropriate way. A subclass from vsg::Viewer::present() to re-implement the present would likely be the way you'd add the required extra calls, or get the details from the viewer and then call vkWaitForPresent there after. It may that this functionality would be best rolled into the core VSG in some fashion. What hardware are you using? |
Beta Was this translation helpful? Give feedback.
I am not familiar with the extension a quick check on my Kubuntu 22.04 + Geforece 2060 shows that it's supported:
$ vsgdeviceselection --extensions | grep VK_KHR_present_wait
extensionName = VK_KHR_present_wait, spec = 1
A quick search online for details on the vkWaitForPresentKHR extension:
https://docs.vulkan.org/refpages/latest/refpages/source/vkWaitForPresentKHR.html
As it's extension it'll need to be enabled why setting up the vsg/vkInstance and vsg/vkDevice, then have the functions called in the appropriate way.
A subclass from vsg::Viewer::present() to re-implement the present would likely be the way you'd add the required extra calls, or get the details from the viewer and then ca…