Allow headset timewarp
This commit is contained in:
@@ -823,8 +823,6 @@ void scenes::stream::render(const XrFrameState & frame_state)
|
|||||||
if (device.waitForFences(*fence, VK_TRUE, UINT64_MAX) == vk::Result::eTimeout)
|
if (device.waitForFences(*fence, VK_TRUE, UINT64_MAX) == vk::Result::eTimeout)
|
||||||
throw std::runtime_error("Vulkan fence timeout");
|
throw std::runtime_error("Vulkan fence timeout");
|
||||||
|
|
||||||
device.resetFences(*fence);
|
|
||||||
|
|
||||||
// We don't need those after vkWaitForFences
|
// We don't need those after vkWaitForFences
|
||||||
current_blit_handles.fill(nullptr);
|
current_blit_handles.fill(nullptr);
|
||||||
|
|
||||||
@@ -942,6 +940,10 @@ void scenes::stream::render(const XrFrameState & frame_state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allow the headset to time warp if we are redisplaying a frame
|
||||||
|
if (std::ranges::any_of(current_blit_handles, [](const auto & h) { return h and h->feedback.times_displayed < 2; }) or
|
||||||
|
is_gui_interactable())
|
||||||
|
{
|
||||||
XrExtent2Di extents[view_count];
|
XrExtent2Di extents[view_count];
|
||||||
{
|
{
|
||||||
int32_t max_width = 0;
|
int32_t max_width = 0;
|
||||||
@@ -1039,6 +1041,7 @@ void scenes::stream::render(const XrFrameState & frame_state)
|
|||||||
};
|
};
|
||||||
submit_info.pNext = &sem_info;
|
submit_info.pNext = &sem_info;
|
||||||
|
|
||||||
|
device.resetFences(*fence);
|
||||||
queue.lock()->submit(submit_info, *fence);
|
queue.lock()->submit(submit_info, *fence);
|
||||||
#if WIVRN_FEATURE_RENDERDOC
|
#if WIVRN_FEATURE_RENDERDOC
|
||||||
renderdoc_end(*vk_instance);
|
renderdoc_end(*vk_instance);
|
||||||
@@ -1096,6 +1099,7 @@ void scenes::stream::render(const XrFrameState & frame_state)
|
|||||||
else
|
else
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Network operations may be blocking, do them once everything was submitted
|
// Network operations may be blocking, do them once everything was submitted
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user