mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-20 02:26:35 +00:00
Start GPU performance counter at 0 instead of host GPU value (#4992)
* Start performance counter at 0 instead of host perf counter value * whitespace * init _firstTimestamp in constructer per feedback * change comment * punctuation * address feedback * revise comment
This commit is contained in:
parent
f8cdd5f484
commit
cb4b58052f
1 changed files with 5 additions and 1 deletions
|
@ -99,6 +99,7 @@ namespace Ryujinx.Graphics.Gpu
|
||||||
private bool _pendingSync;
|
private bool _pendingSync;
|
||||||
|
|
||||||
private long _modifiedSequence;
|
private long _modifiedSequence;
|
||||||
|
private ulong _firstTimestamp;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new instance of the GPU emulation context.
|
/// Creates a new instance of the GPU emulation context.
|
||||||
|
@ -123,6 +124,8 @@ namespace Ryujinx.Graphics.Gpu
|
||||||
DeferredActions = new Queue<Action>();
|
DeferredActions = new Queue<Action>();
|
||||||
|
|
||||||
PhysicalMemoryRegistry = new ConcurrentDictionary<ulong, PhysicalMemory>();
|
PhysicalMemoryRegistry = new ConcurrentDictionary<ulong, PhysicalMemory>();
|
||||||
|
|
||||||
|
_firstTimestamp = ConvertNanosecondsToTicks((ulong)PerformanceCounter.ElapsedNanoseconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -217,7 +220,8 @@ namespace Ryujinx.Graphics.Gpu
|
||||||
/// <returns>The current GPU timestamp</returns>
|
/// <returns>The current GPU timestamp</returns>
|
||||||
public ulong GetTimestamp()
|
public ulong GetTimestamp()
|
||||||
{
|
{
|
||||||
ulong ticks = ConvertNanosecondsToTicks((ulong)PerformanceCounter.ElapsedNanoseconds);
|
// Guest timestamp will start at 0, instead of host value.
|
||||||
|
ulong ticks = ConvertNanosecondsToTicks((ulong)PerformanceCounter.ElapsedNanoseconds) - _firstTimestamp;
|
||||||
|
|
||||||
if (GraphicsConfig.FastGpuTime)
|
if (GraphicsConfig.FastGpuTime)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue