aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Memory
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-12-03 00:38:47 -0200
committerGitHub <noreply@github.com>2018-12-03 00:38:47 -0200
commitc86aacde76b5f8e503e2b412385c8491ecc86b3b (patch)
tree8e4737422fba15199c1a6ce7c6345996c0e907b5 /Ryujinx.Graphics/Memory
parentad00fd02442cf9c0f00c4562635738042b521efa (diff)
NVDEC implementation using FFmpeg (#443)
* Initial nvdec implementation using FFmpeg * Fix swapped channels on the video decoder and the G8R8 texture format * Fix texture samplers not being set properly (regression) * Rebased * Remove unused code introduced on the rebase * Add support for RGBA8 output format on the video image composer * Correct spacing * Some fixes for rebase and other tweaks * Allow size mismatch on frame copy * Get rid of GetHostAddress calls on VDec
Diffstat (limited to 'Ryujinx.Graphics/Memory')
-rw-r--r--Ryujinx.Graphics/Memory/NvGpuBufferType.cs11
-rw-r--r--Ryujinx.Graphics/Memory/NvGpuVmm.cs26
2 files changed, 35 insertions, 2 deletions
diff --git a/Ryujinx.Graphics/Memory/NvGpuBufferType.cs b/Ryujinx.Graphics/Memory/NvGpuBufferType.cs
new file mode 100644
index 00000000..6f0d2571
--- /dev/null
+++ b/Ryujinx.Graphics/Memory/NvGpuBufferType.cs
@@ -0,0 +1,11 @@
+namespace Ryujinx.Graphics.Memory
+{
+ public enum NvGpuBufferType
+ {
+ Index,
+ Vertex,
+ Texture,
+ ConstBuffer,
+ Count
+ }
+} \ No newline at end of file
diff --git a/Ryujinx.Graphics/Memory/NvGpuVmm.cs b/Ryujinx.Graphics/Memory/NvGpuVmm.cs
index ccb21950..cfd1aaeb 100644
--- a/Ryujinx.Graphics/Memory/NvGpuVmm.cs
+++ b/Ryujinx.Graphics/Memory/NvGpuVmm.cs
@@ -72,6 +72,28 @@ namespace Ryujinx.Graphics.Memory
}
}
+ public long MapLow(long PA, long Size)
+ {
+ lock (PageTable)
+ {
+ long VA = GetFreePosition(Size, 1, PageSize);
+
+ if (VA != -1 && (ulong)VA <= uint.MaxValue && (ulong)(VA + Size) <= uint.MaxValue)
+ {
+ for (long Offset = 0; Offset < Size; Offset += PageSize)
+ {
+ SetPte(VA + Offset, PA + Offset);
+ }
+ }
+ else
+ {
+ VA = -1;
+ }
+
+ return VA;
+ }
+ }
+
public long ReserveFixed(long VA, long Size)
{
lock (PageTable)
@@ -122,11 +144,11 @@ namespace Ryujinx.Graphics.Memory
}
}
- private long GetFreePosition(long Size, long Align = 1)
+ private long GetFreePosition(long Size, long Align = 1, long Start = 1L << 32)
{
//Note: Address 0 is not considered valid by the driver,
//when 0 is returned it's considered a mapping error.
- long Position = PageSize;
+ long Position = Start;
long FreeSize = 0;
if (Align < 1)