diff --git a/src/util/util_misc.h b/src/util/util_misc.h index 105f0507..da56f644 100644 --- a/src/util/util_misc.h +++ b/src/util/util_misc.h @@ -36,6 +36,9 @@ namespace dxvk { */ template uint64_t computeRefreshCount(TimePoint t0, TimePoint t1, Duration refreshPeriod) { + if (t1 < t0) + return 0; + auto duration = std::chrono::duration_cast(t1 - t0); return duration.count() / refreshPeriod.count(); }