Send both min and max prediction times
This commit is contained in:
@@ -50,6 +50,7 @@ struct wivrn_comp_target_factory;
|
||||
class tracking_control_t
|
||||
{
|
||||
using T = std::chrono::nanoseconds::rep;
|
||||
std::atomic<T> min;
|
||||
std::atomic<T> max;
|
||||
std::chrono::steady_clock::time_point next_sample;
|
||||
std::mutex mutex;
|
||||
@@ -68,6 +69,13 @@ public:
|
||||
while (prev < sample and max.compare_exchange_weak(prev, sample))
|
||||
{
|
||||
}
|
||||
if (sample > 0)
|
||||
{
|
||||
prev = min;
|
||||
while (prev > sample and min.compare_exchange_weak(prev, sample))
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
void send(wivrn_connection & connection, bool now = false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user