Host1xContext.cs 947 B

1234567891011121314151617181920212223242526272829303132
  1. using Ryujinx.Graphics.Gpu.Memory;
  2. using Ryujinx.Graphics.Host1x;
  3. using Ryujinx.Graphics.Nvdec;
  4. using Ryujinx.Graphics.Vic;
  5. using System;
  6. using GpuContext = Ryujinx.Graphics.Gpu.GpuContext;
  7. namespace Ryujinx.HLE.HOS.Services.Nv
  8. {
  9. class Host1xContext : IDisposable
  10. {
  11. public MemoryManager Smmu { get; }
  12. public NvMemoryAllocator MemoryAllocator { get; }
  13. public Host1xDevice Host1x { get;}
  14. public Host1xContext(GpuContext gpu, long pid)
  15. {
  16. MemoryAllocator = new NvMemoryAllocator();
  17. Host1x = new Host1xDevice(gpu.Synchronization);
  18. Smmu = gpu.CreateMemoryManager(pid);
  19. var nvdec = new NvdecDevice(Smmu);
  20. var vic = new VicDevice(Smmu);
  21. Host1x.RegisterDevice(ClassId.Nvdec, nvdec);
  22. Host1x.RegisterDevice(ClassId.Vic, vic);
  23. }
  24. public void Dispose()
  25. {
  26. Host1x.Dispose();
  27. }
  28. }
  29. }