diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2020-01-01 12:39:09 -0300 |
|---|---|---|
| committer | Thog <thog@protonmail.com> | 2020-01-09 02:13:00 +0100 |
| commit | 92703af5558258da078d876b1d46e916b1065978 (patch) | |
| tree | 6579863103b145b3e7345e42fc03caf870622b43 /Ryujinx.Graphics.Gpu/Engine/MethodReport.cs | |
| parent | 40ef18d7599971c7387779d752a73568685d3432 (diff) | |
Address PR feedback
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/MethodReport.cs')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Engine/MethodReport.cs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/MethodReport.cs b/Ryujinx.Graphics.Gpu/Engine/MethodReport.cs index 8418f0bb..4b6b8fd0 100644 --- a/Ryujinx.Graphics.Gpu/Engine/MethodReport.cs +++ b/Ryujinx.Graphics.Gpu/Engine/MethodReport.cs @@ -8,6 +8,9 @@ namespace Ryujinx.Graphics.Gpu.Engine { partial class Methods { + private const int NsToTicksFractionNumerator = 384; + private const int NsToTicksFractionDenominator = 625; + private ulong _runningCounter; /// <summary> @@ -103,8 +106,10 @@ namespace Ryujinx.Graphics.Gpu.Engine /// <summary> /// Converts a nanoseconds timestamp value to Maxwell time ticks. - /// The frequency is approximately 1.63Hz. /// </summary> + /// <remarks> + /// The frequency is 614400000 Hz. + /// </remarks> /// <param name="nanoseconds">Timestamp in nanoseconds</param> /// <returns>Maxwell ticks</returns> private static ulong ConvertNanosecondsToTicks(ulong nanoseconds) @@ -112,13 +117,13 @@ namespace Ryujinx.Graphics.Gpu.Engine // We need to divide first to avoid overflows. // We fix up the result later by calculating the difference and adding // that to the result. - ulong divided = nanoseconds / 625; + ulong divided = nanoseconds / NsToTicksFractionDenominator; - ulong rounded = divided * 625; + ulong rounded = divided * NsToTicksFractionDenominator; - ulong errorBias = ((nanoseconds - rounded) * 384) / 625; + ulong errorBias = (nanoseconds - rounded) * NsToTicksFractionNumerator / NsToTicksFractionDenominator; - return divided * 384 + errorBias; + return divided * NsToTicksFractionNumerator + errorBias; } } }
\ No newline at end of file |
