mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2025-04-07 08:51:39 +00:00
OpenXR frameskip integrated
This commit is contained in:
parent
f735535dce
commit
26071937c8
2 changed files with 5 additions and 2 deletions
|
@ -343,6 +343,9 @@ void VR_DrawFrame( engine_t* engine ) {
|
||||||
|
|
||||||
OXR(xrWaitFrame(engine->appState.Session, &waitFrameInfo, &frameState));
|
OXR(xrWaitFrame(engine->appState.Session, &waitFrameInfo, &frameState));
|
||||||
engine->predictedDisplayTime = frameState.predictedDisplayTime;
|
engine->predictedDisplayTime = frameState.predictedDisplayTime;
|
||||||
|
if (!frameState.shouldRender) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Get the HMD pose, predicted for the middle of the time period during which
|
// Get the HMD pose, predicted for the middle of the time period during which
|
||||||
// the new eye images will be displayed. The number of frames predicted ahead
|
// the new eye images will be displayed. The number of frames predicted ahead
|
||||||
|
|
|
@ -173,14 +173,14 @@ void ovrFramebuffer_Acquire(ovrFramebuffer* frameBuffer) {
|
||||||
XrSwapchainImageWaitInfo waitInfo;
|
XrSwapchainImageWaitInfo waitInfo;
|
||||||
waitInfo.type = XR_TYPE_SWAPCHAIN_IMAGE_WAIT_INFO;
|
waitInfo.type = XR_TYPE_SWAPCHAIN_IMAGE_WAIT_INFO;
|
||||||
waitInfo.next = NULL;
|
waitInfo.next = NULL;
|
||||||
waitInfo.timeout = 1000000000; /* timeout in nanoseconds */
|
waitInfo.timeout = 1000; /* timeout in nanoseconds */
|
||||||
XrResult res = xrWaitSwapchainImage(frameBuffer->ColorSwapChain.Handle, &waitInfo);
|
XrResult res = xrWaitSwapchainImage(frameBuffer->ColorSwapChain.Handle, &waitInfo);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (res != XR_SUCCESS) {
|
while (res != XR_SUCCESS) {
|
||||||
res = xrWaitSwapchainImage(frameBuffer->ColorSwapChain.Handle, &waitInfo);
|
res = xrWaitSwapchainImage(frameBuffer->ColorSwapChain.Handle, &waitInfo);
|
||||||
i++;
|
i++;
|
||||||
ALOGV(
|
ALOGV(
|
||||||
" Retry xrWaitSwapchainImage %d times due to XR_TIMEOUT_EXPIRED (duration %f seconds)",
|
" Retry xrWaitSwapchainImage %d times due to XR_TIMEOUT_EXPIRED (duration %f micro seconds)",
|
||||||
i,
|
i,
|
||||||
waitInfo.timeout * (1E-9));
|
waitInfo.timeout * (1E-9));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue