From 4a4e2f7c72301ba1dfb207f00c7c2fa0e9674223 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 31 Dec 2019 16:19:44 -0300 Subject: Add XML documentation to Ryujinx.Graphics.Gpu.Engine --- Ryujinx.Graphics.Gpu/Engine/MethodReport.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'Ryujinx.Graphics.Gpu/Engine/MethodReport.cs') diff --git a/Ryujinx.Graphics.Gpu/Engine/MethodReport.cs b/Ryujinx.Graphics.Gpu/Engine/MethodReport.cs index f73c03cb..8418f0bb 100644 --- a/Ryujinx.Graphics.Gpu/Engine/MethodReport.cs +++ b/Ryujinx.Graphics.Gpu/Engine/MethodReport.cs @@ -10,6 +10,11 @@ namespace Ryujinx.Graphics.Gpu.Engine { private ulong _runningCounter; + /// + /// Writes a GPU counter to guest memory. + /// + /// Current GPU state + /// Method call argument private void Report(GpuState state, int argument) { ReportMode mode = (ReportMode)(argument & 3); @@ -23,6 +28,10 @@ namespace Ryujinx.Graphics.Gpu.Engine } } + /// + /// Writes a GPU semaphore value to guest memory. + /// + /// Current GPU state private void ReportSemaphore(GpuState state) { var rs = state.Get(MethodOffset.ReportState); @@ -32,12 +41,21 @@ namespace Ryujinx.Graphics.Gpu.Engine _context.AdvanceSequence(); } + /// + /// Packed GPU counter data (including GPU timestamp) in memory. + /// private struct CounterData { public ulong Counter; public ulong Timestamp; } + /// + /// Writes a GPU counter to guest memory. + /// This also writes the current timestamp value. + /// + /// Current GPU state + /// Counter to be written to memory private void ReportCounter(GpuState state, ReportCounterType type) { CounterData counterData = new CounterData(); @@ -83,6 +101,12 @@ namespace Ryujinx.Graphics.Gpu.Engine _context.MemoryAccessor.Write(rs.Address.Pack(), data); } + /// + /// Converts a nanoseconds timestamp value to Maxwell time ticks. + /// The frequency is approximately 1.63Hz. + /// + /// Timestamp in nanoseconds + /// Maxwell ticks private static ulong ConvertNanosecondsToTicks(ulong nanoseconds) { // We need to divide first to avoid overflows. -- cgit v1.2.3