diff options
author | gdkchan <gab.dark.100@gmail.com> | 2020-04-20 09:41:07 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-20 22:41:07 +1000 |
commit | 91fa1debd4c5791a12733d75d7ce06a23a1547ff (patch) | |
tree | 490b5cdf856ed969e66db36360c3d9ea7160a205 | |
parent | ca8745fc8e28d5ac51d4ab1921a96b3eb3abc03f (diff) |
Report more realistic GPU timestamps when FastGpuTime is enabled (#1139)
-rw-r--r-- | Ryujinx.Graphics.Gpu/Engine/MethodReport.cs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/MethodReport.cs b/Ryujinx.Graphics.Gpu/Engine/MethodReport.cs index 0565acdc..15151c62 100644 --- a/Ryujinx.Graphics.Gpu/Engine/MethodReport.cs +++ b/Ryujinx.Graphics.Gpu/Engine/MethodReport.cs @@ -11,8 +11,6 @@ namespace Ryujinx.Graphics.Gpu.Engine private const int NsToTicksFractionNumerator = 384; private const int NsToTicksFractionDenominator = 625; - private ulong _runningCounter; - /// <summary> /// Writes a GPU counter to guest memory. /// </summary> @@ -81,15 +79,13 @@ namespace Ryujinx.Graphics.Gpu.Engine break; } - ulong ticks; + ulong ticks = ConvertNanosecondsToTicks((ulong)PerformanceCounter.ElapsedNanoseconds); if (GraphicsConfig.FastGpuTime) { - ticks = _runningCounter++; - } - else - { - ticks = ConvertNanosecondsToTicks((ulong)PerformanceCounter.ElapsedNanoseconds); + // Divide by some amount to report time as if operations were performed faster than they really are. + // This can prevent some games from switching to a lower resolution because rendering is too slow. + ticks /= 256; } counterData.Counter = counter; |