mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-11-28 11:50:50 +01:00
Report more realistic GPU timestamps when FastGpuTime is enabled (#1139)
This commit is contained in:
parent
ca8745fc8e
commit
91fa1debd4
@ -11,8 +11,6 @@ namespace Ryujinx.Graphics.Gpu.Engine
|
|||||||
private const int NsToTicksFractionNumerator = 384;
|
private const int NsToTicksFractionNumerator = 384;
|
||||||
private const int NsToTicksFractionDenominator = 625;
|
private const int NsToTicksFractionDenominator = 625;
|
||||||
|
|
||||||
private ulong _runningCounter;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Writes a GPU counter to guest memory.
|
/// Writes a GPU counter to guest memory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -81,15 +79,13 @@ namespace Ryujinx.Graphics.Gpu.Engine
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ulong ticks;
|
ulong ticks = ConvertNanosecondsToTicks((ulong)PerformanceCounter.ElapsedNanoseconds);
|
||||||
|
|
||||||
if (GraphicsConfig.FastGpuTime)
|
if (GraphicsConfig.FastGpuTime)
|
||||||
{
|
{
|
||||||
ticks = _runningCounter++;
|
// 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.
|
||||||
else
|
ticks /= 256;
|
||||||
{
|
|
||||||
ticks = ConvertNanosecondsToTicks((ulong)PerformanceCounter.ElapsedNanoseconds);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
counterData.Counter = counter;
|
counterData.Counter = counter;
|
||||||
|
Loading…
Reference in New Issue
Block a user