mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-10-01 12:30:00 +02:00
f4f496cb48
* Use separate NVDEC contexts per channel (for FFMPEG) * Remove NVDEC -> VIC frame override hack * Add missing bottom_field_pic_order_in_frame_present_flag * Make FFMPEG logging static * nit: Remove empty lines * New FFMPEG decoding approach -- call h264_decode_frame directly, trim surface cache to reduce memory usage * Fix case * Silence warnings * PR feedback * Per-decoder rather than per-codec ownership of surfaces on the cache
32 lines
No EOL
947 B
C#
32 lines
No EOL
947 B
C#
using Ryujinx.Graphics.Gpu.Memory;
|
|
using Ryujinx.Graphics.Host1x;
|
|
using Ryujinx.Graphics.Nvdec;
|
|
using Ryujinx.Graphics.Vic;
|
|
using System;
|
|
using GpuContext = Ryujinx.Graphics.Gpu.GpuContext;
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Nv
|
|
{
|
|
class Host1xContext : IDisposable
|
|
{
|
|
public MemoryManager Smmu { get; }
|
|
public NvMemoryAllocator MemoryAllocator { get; }
|
|
public Host1xDevice Host1x { get;}
|
|
|
|
public Host1xContext(GpuContext gpu, long pid)
|
|
{
|
|
MemoryAllocator = new NvMemoryAllocator();
|
|
Host1x = new Host1xDevice(gpu.Synchronization);
|
|
Smmu = gpu.CreateMemoryManager(pid);
|
|
var nvdec = new NvdecDevice(Smmu);
|
|
var vic = new VicDevice(Smmu);
|
|
Host1x.RegisterDevice(ClassId.Nvdec, nvdec);
|
|
Host1x.RegisterDevice(ClassId.Vic, vic);
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Host1x.Dispose();
|
|
}
|
|
}
|
|
} |