From 6bfe4715f05be10c73a788abd8727293a7eca77e Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 22 Apr 2020 03:00:11 -0300 Subject: Initial conditional rendering support (#1012) * Initial conditional rendering support * Properly reset state * Support conditional modes and skeleton a counter cache for future host conditional rendering * Address PR feedback --- Ryujinx.Graphics.Gpu/Engine/MethodReport.cs | 7 +++++++ 1 file changed, 7 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 15151c62..eeec3569 100644 --- a/Ryujinx.Graphics.Gpu/Engine/MethodReport.cs +++ b/Ryujinx.Graphics.Gpu/Engine/MethodReport.cs @@ -1,5 +1,6 @@ using Ryujinx.Common; using Ryujinx.Graphics.GAL; +using Ryujinx.Graphics.Gpu.Memory; using Ryujinx.Graphics.Gpu.State; using System; using System.Runtime.InteropServices; @@ -11,6 +12,10 @@ namespace Ryujinx.Graphics.Gpu.Engine private const int NsToTicksFractionNumerator = 384; private const int NsToTicksFractionDenominator = 625; + private ulong _runningCounter; + + private readonly CounterCache _counterCache = new CounterCache(); + /// /// Writes a GPU counter to guest memory. /// @@ -98,6 +103,8 @@ namespace Ryujinx.Graphics.Gpu.Engine var rs = state.Get(MethodOffset.ReportState); _context.MemoryAccessor.Write(rs.Address.Pack(), data); + + _counterCache.AddOrUpdate(rs.Address.Pack()); } /// -- cgit v1.2.3