2018-02-20 21:09:23 +01:00
|
|
|
using Ryujinx.Graphics.Gal;
|
2018-12-03 03:38:47 +01:00
|
|
|
using Ryujinx.Graphics.Graphics3d;
|
|
|
|
using Ryujinx.Graphics.Memory;
|
|
|
|
using Ryujinx.Graphics.VDec;
|
|
|
|
using Ryujinx.Graphics.Vic;
|
2018-02-20 21:09:23 +01:00
|
|
|
|
2018-09-08 19:51:50 +02:00
|
|
|
namespace Ryujinx.Graphics
|
2018-02-20 21:09:23 +01:00
|
|
|
{
|
2018-09-08 19:51:50 +02:00
|
|
|
public class NvGpu
|
2018-02-20 21:09:23 +01:00
|
|
|
{
|
2019-03-02 11:50:21 +01:00
|
|
|
public const int MaxViewportSize = 0x3FFF;
|
|
|
|
|
2018-02-20 21:09:23 +01:00
|
|
|
public IGalRenderer Renderer { get; private set; }
|
|
|
|
|
2018-09-18 06:30:35 +02:00
|
|
|
public GpuResourceManager ResourceManager { get; private set; }
|
|
|
|
|
2018-11-17 05:01:31 +01:00
|
|
|
public DmaPusher Pusher { get; private set; }
|
2018-04-08 21:17:35 +02:00
|
|
|
|
2018-11-17 05:01:31 +01:00
|
|
|
internal NvGpuFifo Fifo { get; private set; }
|
2018-09-18 06:30:35 +02: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 21:17:35 +02:00
|
|
|
|
2019-03-04 02:45:25 +01:00
|
|
|
private CdmaProcessor _cdmaProcessor;
|
2018-12-03 03:38:47 +01:00
|
|
|
internal VideoDecoder VideoDecoder { get; private set; }
|
|
|
|
internal VideoImageComposer VideoImageComposer { get; private set; }
|
|
|
|
|
2019-03-04 02:45:25 +01:00
|
|
|
public NvGpu(IGalRenderer renderer)
|
2018-02-20 21:09:23 +01:00
|
|
|
{
|
2019-03-04 02:45:25 +01:00
|
|
|
Renderer = renderer;
|
2018-02-20 21:09:23 +01:00
|
|
|
|
2018-09-18 06:30:35 +02:00
|
|
|
ResourceManager = new GpuResourceManager(this);
|
|
|
|
|
2018-11-17 05:01:31 +01:00
|
|
|
Pusher = new DmaPusher(this);
|
2018-04-08 21:17:35 +02:00
|
|
|
|
2018-11-17 05:01:31 +01:00
|
|
|
Fifo = new NvGpuFifo(this);
|
2018-09-18 06:30:35 +02:00
|
|
|
Engine2d = new NvGpuEngine2d(this);
|
|
|
|
Engine3d = new NvGpuEngine3d(this);
|
|
|
|
EngineM2mf = new NvGpuEngineM2mf(this);
|
|
|
|
EngineP2mf = new NvGpuEngineP2mf(this);
|
2018-12-03 03:38:47 +01:00
|
|
|
|
2019-03-04 02:45:25 +01:00
|
|
|
_cdmaProcessor = new CdmaProcessor(this);
|
2018-12-03 03:38:47 +01:00
|
|
|
VideoDecoder = new VideoDecoder(this);
|
|
|
|
VideoImageComposer = new VideoImageComposer(this);
|
|
|
|
}
|
|
|
|
|
2019-03-04 02:45:25 +01:00
|
|
|
public void PushCommandBuffer(NvGpuVmm vmm, int[] cmdBuffer)
|
2018-12-03 03:38:47 +01:00
|
|
|
{
|
2019-03-04 02:45:25 +01:00
|
|
|
lock (_cdmaProcessor)
|
2018-12-03 03:38:47 +01:00
|
|
|
{
|
2019-03-04 02:45:25 +01:00
|
|
|
_cdmaProcessor.PushCommands(vmm, cmdBuffer);
|
2018-12-03 03:38:47 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void UninitializeVideoDecoder()
|
|
|
|
{
|
2019-03-04 02:45:25 +01:00
|
|
|
lock (_cdmaProcessor)
|
2018-12-03 03:38:47 +01:00
|
|
|
{
|
|
|
|
FFmpegWrapper.Uninitialize();
|
|
|
|
}
|
2018-04-08 21:17:35 +02:00
|
|
|
}
|
2018-02-20 21:09:23 +01:00
|
|
|
}
|
|
|
|
}
|