aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Engine/MethodFifo.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-07-23 23:53:25 -0300
committerGitHub <noreply@github.com>2020-07-23 23:53:25 -0300
commit5a7df48975bcb04b1805031a26f5007211fe4c62 (patch)
tree7de88433b0427368d08b13d061c69ebeaf265624 /Ryujinx.Graphics.Gpu/Engine/MethodFifo.cs
parent3c1f220c5ec6ea824e6a0c12d77fd8ce01ee0d1b (diff)
New GPFifo and fast guest constant buffer updates (#1400)
* Add new structures from official docs, start migrating GPFifo * Finish migration to new GPFifo processor * Implement fast constant buffer data upload * Migrate to new GPFifo class * XML docs
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/MethodFifo.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Engine/MethodFifo.cs103
1 files changed, 0 insertions, 103 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/MethodFifo.cs b/Ryujinx.Graphics.Gpu/Engine/MethodFifo.cs
deleted file mode 100644
index c1f45941..00000000
--- a/Ryujinx.Graphics.Gpu/Engine/MethodFifo.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-using Ryujinx.Graphics.Gpu.State;
-using System.Threading;
-
-namespace Ryujinx.Graphics.Gpu.Engine
-{
- partial class Methods
- {
- /// <summary>
- /// Writes a GPU counter to guest memory.
- /// </summary>
- /// <param name="state">Current GPU state</param>
- /// <param name="argument">Method call argument</param>
- public void Semaphore(GpuState state, int argument)
- {
- FifoSemaphoreOperation op = (FifoSemaphoreOperation)(argument & 3);
-
- var semaphore = state.Get<SemaphoreState>(MethodOffset.Semaphore);
-
- int value = semaphore.Payload;
-
- if (op == FifoSemaphoreOperation.Counter)
- {
- // TODO: There's much more that should be done here.
- // NVN only supports the "Accumulate" mode, so we
- // can't currently guess which bits specify the
- // reduction operation.
- value += _context.MemoryAccessor.Read<int>(semaphore.Address.Pack());
- }
-
- _context.MemoryAccessor.Write(semaphore.Address.Pack(), value);
-
- _context.AdvanceSequence();
- }
-
- /// <summary>
- /// Waits for the GPU to be idle.
- /// </summary>
- /// <param name="state">Current GPU state</param>
- /// <param name="argument">Method call argument</param>
- public void WaitForIdle(GpuState state, int argument)
- {
- PerformDeferredDraws();
-
- _context.Renderer.Pipeline.Barrier();
- }
-
- /// <summary>
- /// Send macro code/data to the MME.
- /// </summary>
- /// <param name="state">Current GPU state</param>
- /// <param name="argument">Method call argument</param>
- public void SendMacroCodeData(GpuState state, int argument)
- {
- int macroUploadAddress = state.Get<int>(MethodOffset.MacroUploadAddress);
-
- _context.Fifo.SendMacroCodeData(macroUploadAddress++, argument);
-
- state.Write((int)MethodOffset.MacroUploadAddress, macroUploadAddress);
- }
-
- /// <summary>
- /// Bind a macro index to a position for the MME.
- /// </summary>
- /// <param name="state">Current GPU state</param>
- /// <param name="argument">Method call argument</param>
- public void BindMacro(GpuState state, int argument)
- {
- int macroBindingIndex = state.Get<int>(MethodOffset.MacroBindingIndex);
-
- _context.Fifo.BindMacro(macroBindingIndex++, argument);
-
- state.Write((int)MethodOffset.MacroBindingIndex, macroBindingIndex);
- }
-
- public void SetMmeShadowRamControl(GpuState state, int argument)
- {
- _context.Fifo.SetMmeShadowRamControl((ShadowRamControl)argument);
- }
-
- /// <summary>
- /// Apply a fence operation on a syncpoint.
- /// </summary>
- /// <param name="state">Current GPU state</param>
- /// <param name="argument">Method call argument</param>
- public void FenceAction(GpuState state, int argument)
- {
- uint threshold = state.Get<uint>(MethodOffset.FenceValue);
-
- FenceActionOperation operation = (FenceActionOperation)(argument & 1);
-
- uint syncpointId = (uint)(argument >> 8) & 0xFF;
-
- if (operation == FenceActionOperation.Acquire)
- {
- _context.Synchronization.WaitOnSyncpoint(syncpointId, threshold, Timeout.InfiniteTimeSpan);
- }
- else if (operation == FenceActionOperation.Increment)
- {
- _context.Synchronization.IncrementSyncpoint(syncpointId);
- }
- }
- }
-}