2018-02-20 15:09:23 -05:00
|
|
|
using Ryujinx.Graphics.Gal;
|
2018-12-02 21:38:47 -05:00
|
|
|
using Ryujinx.Graphics.Graphics3d;
|
|
|
|
using Ryujinx.Graphics.Memory;
|
|
|
|
using Ryujinx.Graphics.VDec;
|
|
|
|
using Ryujinx.Graphics.Vic;
|
2018-02-20 15:09:23 -05:00
|
|
|
|
2018-09-08 13:51:50 -04:00
|
|
|
namespace Ryujinx.Graphics
|
2018-02-20 15:09:23 -05:00
|
|
|
{
|
2018-09-08 13:51:50 -04:00
|
|
|
public class NvGpu
|
2018-02-20 15:09:23 -05:00
|
|
|
{
|
|
|
|
public IGalRenderer Renderer { get; private set; }
|
|
|
|
|
2018-09-18 00:30:35 -04:00
|
|
|
public GpuResourceManager ResourceManager { get; private set; }
|
|
|
|
|
2018-11-16 23:01:31 -05:00
|
|
|
public DmaPusher Pusher { get; private set; }
|
2018-04-08 15:17:35 -04:00
|
|
|
|
2018-11-16 23:01:31 -05:00
|
|
|
internal NvGpuFifo Fifo { get; private set; }
|
2018-09-18 00:30:35 -04:00
|
|
|
internal NvGpuEngine2d Engine2d { get; private set; }
|
|
|
|
internal NvGpuEngine3d Engine3d { get; private set; }
|
|
|
|
internal NvGpuEngineM2mf EngineM2mf { get; private set; }
|
|
|
|
internal NvGpuEngineP2mf EngineP2mf { get; private set; }
|
2018-04-08 15:17:35 -04:00
|
|
|
|
2018-12-02 21:38:47 -05:00
|
|
|
private CdmaProcessor CdmaProcessor;
|
|
|
|
internal VideoDecoder VideoDecoder { get; private set; }
|
|
|
|
internal VideoImageComposer VideoImageComposer { get; private set; }
|
|
|
|
|
NvServices refactoring (#120)
* Initial implementation of NvMap/NvHostCtrl
* More work on NvHostCtrl
* Refactoring of nvservices, move GPU Vmm, make Vmm per-process, refactor most gpu devices, move Gpu to Core, fix CbBind
* Implement GetGpuTime, support CancelSynchronization, fix issue on InsertWaitingMutex, proper double buffering support (again, not working properly for commercial games, only hb)
* Try to fix perf regression reading/writing textures, moved syncpts and events to a UserCtx class, delete global state when the process exits, other minor tweaks
* Remove now unused code, add comment about probably wrong result codes
2018-05-07 14:53:23 -04:00
|
|
|
public NvGpu(IGalRenderer Renderer)
|
2018-02-20 15:09:23 -05:00
|
|
|
{
|
|
|
|
this.Renderer = Renderer;
|
|
|
|
|
2018-09-18 00:30:35 -04:00
|
|
|
ResourceManager = new GpuResourceManager(this);
|
|
|
|
|
2018-11-16 23:01:31 -05:00
|
|
|
Pusher = new DmaPusher(this);
|
2018-04-08 15:17:35 -04:00
|
|
|
|
2018-11-16 23:01:31 -05:00
|
|
|
Fifo = new NvGpuFifo(this);
|
2018-09-18 00:30:35 -04:00
|
|
|
Engine2d = new NvGpuEngine2d(this);
|
|
|
|
Engine3d = new NvGpuEngine3d(this);
|
|
|
|
EngineM2mf = new NvGpuEngineM2mf(this);
|
|
|
|
EngineP2mf = new NvGpuEngineP2mf(this);
|
2018-12-02 21:38:47 -05:00
|
|
|
|
|
|
|
CdmaProcessor = new CdmaProcessor(this);
|
|
|
|
VideoDecoder = new VideoDecoder(this);
|
|
|
|
VideoImageComposer = new VideoImageComposer(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void PushCommandBuffer(NvGpuVmm Vmm, int[] CmdBuffer)
|
|
|
|
{
|
|
|
|
lock (CdmaProcessor)
|
|
|
|
{
|
|
|
|
CdmaProcessor.PushCommands(Vmm, CmdBuffer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void UninitializeVideoDecoder()
|
|
|
|
{
|
|
|
|
lock (CdmaProcessor)
|
|
|
|
{
|
|
|
|
FFmpegWrapper.Uninitialize();
|
|
|
|
}
|
2018-04-08 15:17:35 -04:00
|
|
|
}
|
2018-02-20 15:09:23 -05:00
|
|
|
}
|
|
|
|
}
|