Skip to content

Commit

Permalink
openxr: Fix sleep time
Browse files Browse the repository at this point in the history
We don't want to increase the sleep time.  That would mean we wait
longer than we want for previously missed events.  Only reduce the
retry limit so we don't get the longer sleep times.
  • Loading branch information
MarkY-LunarG committed Nov 1, 2024
1 parent 1d48a4f commit b370cc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions framework/decode/openxr_replay_consumer_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -880,13 +880,11 @@ void OpenXrReplayConsumerBase::Process_xrPollEvent(const ApiCallInfo&
uint32_t retry_count = 0;
int64_t sleep_time = 1;

// Shift the sleep time by how much we're willing to sleep. Also start the retry count
// at the appropriate point. If we continue to fail to get events of this type, eventually
// we will just stop waiting for them.
if (event_behavior_tracking_[capture_event->type].allow_timeout_reduction)
{
// Adjust the time we wait so that we don't wait as long by dropping the retry count
// by the number of times we've missed the event previously.
uint32_t current_reduction = event_behavior_tracking_[capture_event->type].current_timeout_reduction;
sleep_time = static_cast<int64_t>(1 << current_reduction);
if (current_reduction >= retry_limit)
{
retry_limit = 0;
Expand Down

0 comments on commit b370cc6

Please sign in to comment.