aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Vic
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-09-28 19:43:40 -0300
committerGitHub <noreply@github.com>2021-09-29 00:43:40 +0200
commitf4f496cb48a59aae36e3252baa90396e1bfadd2e (patch)
tree5594d76b3f1b552f1fecdeda37bd2f6667781a56 /Ryujinx.Graphics.Vic
parent0d23504e30395ba20d1704da464b41f3fe539062 (diff)
NVDEC (H264): Use separate contexts per channel and decode frames in DTS order (#2671)
* 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
Diffstat (limited to 'Ryujinx.Graphics.Vic')
-rw-r--r--Ryujinx.Graphics.Vic/VicDevice.cs38
-rw-r--r--Ryujinx.Graphics.Vic/VicRegisters.cs2
2 files changed, 3 insertions, 37 deletions
diff --git a/Ryujinx.Graphics.Vic/VicDevice.cs b/Ryujinx.Graphics.Vic/VicDevice.cs
index db4fe513..21021c58 100644
--- a/Ryujinx.Graphics.Vic/VicDevice.cs
+++ b/Ryujinx.Graphics.Vic/VicDevice.cs
@@ -1,9 +1,7 @@
-using Ryujinx.Common.Logging;
-using Ryujinx.Graphics.Device;
+using Ryujinx.Graphics.Device;
using Ryujinx.Graphics.Gpu.Memory;
using Ryujinx.Graphics.Vic.Image;
using Ryujinx.Graphics.Vic.Types;
-using System;
using System.Collections.Generic;
namespace Ryujinx.Graphics.Vic
@@ -14,9 +12,6 @@ namespace Ryujinx.Graphics.Vic
private readonly ResourceManager _rm;
private readonly DeviceState<VicRegisters> _state;
- private PlaneOffsets _overrideOffsets;
- private bool _hasOverride;
-
public VicDevice(MemoryManager gmm)
{
_gmm = gmm;
@@ -27,32 +22,6 @@ namespace Ryujinx.Graphics.Vic
});
}
- /// <summary>
- /// Overrides all input surfaces with a custom surface.
- /// </summary>
- /// <param name="lumaOffset">Offset of the luma plane or packed data for this surface</param>
- /// <param name="chromaUOffset">Offset of the U chroma plane (for planar formats) or both chroma planes (for semiplanar formats)</param>
- /// <param name="chromaVOffset">Offset of the V chroma plane for planar formats</param>
- public void SetSurfaceOverride(uint lumaOffset, uint chromaUOffset, uint chromaVOffset)
- {
- _overrideOffsets.LumaOffset = lumaOffset;
- _overrideOffsets.ChromaUOffset = chromaUOffset;
- _overrideOffsets.ChromaVOffset = chromaVOffset;
- _hasOverride = true;
- }
-
- /// <summary>
- /// Disables overriding input surfaces.
- /// </summary>
- /// <remarks>
- /// Surface overrides are disabled by default.
- /// Call this if you previously called <see cref="SetSurfaceOverride(uint, uint, uint)"/> and which to disable it.
- /// </remarks>
- public void DisableSurfaceOverride()
- {
- _hasOverride = false;
- }
-
public int Read(int offset) => _state.Read(offset);
public void Write(int offset, int data) => _state.Write(offset, data);
@@ -76,11 +45,6 @@ namespace Ryujinx.Graphics.Vic
var offsets = _state.State.SetSurfacexSlotx[i][0];
- if (_hasOverride)
- {
- offsets = _overrideOffsets;
- }
-
using Surface src = SurfaceReader.Read(_rm, ref slot.SlotSurfaceConfig, ref offsets);
Blender.BlendOne(output, src, ref slot);
diff --git a/Ryujinx.Graphics.Vic/VicRegisters.cs b/Ryujinx.Graphics.Vic/VicRegisters.cs
index 74d41ade..1c11b554 100644
--- a/Ryujinx.Graphics.Vic/VicRegisters.cs
+++ b/Ryujinx.Graphics.Vic/VicRegisters.cs
@@ -4,9 +4,11 @@ namespace Ryujinx.Graphics.Vic
{
struct PlaneOffsets
{
+#pragma warning disable CS0649
public uint LumaOffset;
public uint ChromaUOffset;
public uint ChromaVOffset;
+#pragma warning restore CS0649
}
struct VicRegisters