aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/NvGpuFifo.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-09-18 01:30:35 -0300
committerGitHub <noreply@github.com>2018-09-18 01:30:35 -0300
commitd4187aaa9d7194aa26d04aee838edbc3a38f1862 (patch)
tree06fe725c1067b4aeca21749799b835d85e7d2787 /Ryujinx.Graphics/NvGpuFifo.cs
parentbec95cacc1061f91373a1e3a1411981af7fe2e4e (diff)
Allow "reinterpretation" of framebuffer/zeta formats (#418)
* (Re)Implement format reinterpretation, other changes * Implement writeback to guest memory, some refactoring * More refactoring, implement reinterpretation the old way again * Clean up * Some fixes on M2MF (old Dma engine), added partial support for P2MF, fix conditional ssy, add Z24S8 zeta format, other fixes * nit: Formatting * Address PR feedback
Diffstat (limited to 'Ryujinx.Graphics/NvGpuFifo.cs')
-rw-r--r--Ryujinx.Graphics/NvGpuFifo.cs65
1 files changed, 35 insertions, 30 deletions
diff --git a/Ryujinx.Graphics/NvGpuFifo.cs b/Ryujinx.Graphics/NvGpuFifo.cs
index 3b79a055..16d16f5e 100644
--- a/Ryujinx.Graphics/NvGpuFifo.cs
+++ b/Ryujinx.Graphics/NvGpuFifo.cs
@@ -94,6 +94,8 @@ namespace Ryujinx.Graphics
Gpu.Engine3d.ResetCache();
+ Gpu.ResourceManager.ClearPbCache();
+
CurrPbEntryIndex = 0;
}
@@ -104,19 +106,35 @@ namespace Ryujinx.Graphics
private void CallMethod(NvGpuVmm Vmm, NvGpuPBEntry PBEntry)
{
- if (PBEntry.Method < 0x80)
+ if ((NvGpuFifoMeth)PBEntry.Method == NvGpuFifoMeth.BindChannel)
{
- switch ((NvGpuFifoMeth)PBEntry.Method)
- {
- case NvGpuFifoMeth.BindChannel:
- {
- NvGpuEngine Engine = (NvGpuEngine)PBEntry.Arguments[0];
+ NvGpuEngine Engine = (NvGpuEngine)PBEntry.Arguments[0];
- SubChannels[PBEntry.SubChannel] = Engine;
+ SubChannels[PBEntry.SubChannel] = Engine;
+ }
+ else
+ {
+ switch (SubChannels[PBEntry.SubChannel])
+ {
+ case NvGpuEngine._2d: Call2dMethod (Vmm, PBEntry); break;
+ case NvGpuEngine._3d: Call3dMethod (Vmm, PBEntry); break;
+ case NvGpuEngine.P2mf: CallP2mfMethod(Vmm, PBEntry); break;
+ case NvGpuEngine.M2mf: CallM2mfMethod(Vmm, PBEntry); break;
+ }
+ }
+ }
- break;
- }
+ private void Call2dMethod(NvGpuVmm Vmm, NvGpuPBEntry PBEntry)
+ {
+ Gpu.Engine2d.CallMethod(Vmm, PBEntry);
+ }
+ private void Call3dMethod(NvGpuVmm Vmm, NvGpuPBEntry PBEntry)
+ {
+ if (PBEntry.Method < 0x80)
+ {
+ switch ((NvGpuFifoMeth)PBEntry.Method)
+ {
case NvGpuFifoMeth.SetMacroUploadAddress:
{
CurrMacroPosition = PBEntry.Arguments[0];
@@ -150,25 +168,7 @@ namespace Ryujinx.Graphics
}
}
}
- else
- {
- switch (SubChannels[PBEntry.SubChannel])
- {
- case NvGpuEngine._2d: Call2dMethod (Vmm, PBEntry); break;
- case NvGpuEngine._3d: Call3dMethod (Vmm, PBEntry); break;
- case NvGpuEngine.Dma: CallDmaMethod(Vmm, PBEntry); break;
- }
- }
- }
-
- private void Call2dMethod(NvGpuVmm Vmm, NvGpuPBEntry PBEntry)
- {
- Gpu.Engine2d.CallMethod(Vmm, PBEntry);
- }
-
- private void Call3dMethod(NvGpuVmm Vmm, NvGpuPBEntry PBEntry)
- {
- if (PBEntry.Method < 0xe00)
+ else if (PBEntry.Method < 0xe00)
{
Gpu.Engine3d.CallMethod(Vmm, PBEntry);
}
@@ -190,9 +190,14 @@ namespace Ryujinx.Graphics
}
}
- private void CallDmaMethod(NvGpuVmm Vmm, NvGpuPBEntry PBEntry)
+ private void CallP2mfMethod(NvGpuVmm Vmm, NvGpuPBEntry PBEntry)
+ {
+ Gpu.EngineP2mf.CallMethod(Vmm, PBEntry);
+ }
+
+ private void CallM2mfMethod(NvGpuVmm Vmm, NvGpuPBEntry PBEntry)
{
- Gpu.EngineDma.CallMethod(Vmm, PBEntry);
+ Gpu.EngineM2mf.CallMethod(Vmm, PBEntry);
}
}
} \ No newline at end of file