aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Core/OsHle/Services/Vi
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-03-20 12:18:25 -0300
committergdkchan <gab.dark.100@gmail.com>2018-03-20 12:18:25 -0300
commit1bd99e559785ecf6a40e1bcb4a717642014c078f (patch)
tree5d167c29acefd0d2f108348b79ff03ef5b89f6db /Ryujinx.Core/OsHle/Services/Vi
parent4314a8f3e5b76bbf2143f701c06e9354de712027 (diff)
Support different framebuffer offsets (fixes #59)
Diffstat (limited to 'Ryujinx.Core/OsHle/Services/Vi')
-rw-r--r--Ryujinx.Core/OsHle/Services/Vi/NvFlinger.cs17
1 files changed, 13 insertions, 4 deletions
diff --git a/Ryujinx.Core/OsHle/Services/Vi/NvFlinger.cs b/Ryujinx.Core/OsHle/Services/Vi/NvFlinger.cs
index 3a7a2ee6..550260bb 100644
--- a/Ryujinx.Core/OsHle/Services/Vi/NvFlinger.cs
+++ b/Ryujinx.Core/OsHle/Services/Vi/NvFlinger.cs
@@ -289,11 +289,20 @@ namespace Ryujinx.Core.OsHle.IpcServices.Android
long FbSize = (uint)FbWidth * FbHeight * 4;
- NvMap NvMap = GetNvMap(Context, Slot);
+ NvMap Map = GetNvMap(Context, Slot);
- if ((ulong)(NvMap.Address + FbSize) > AMemoryMgr.AddrSize)
+ NvMapFb MapFb = (NvMapFb)ServiceNvDrv.NvMapsFb.GetData(Context.Process, 0);
+
+ long Address = Map.CpuAddress;
+
+ if (MapFb.HasBufferOffset(Slot))
+ {
+ Address += MapFb.GetBufferOffset(Slot);
+ }
+
+ if ((ulong)(Address + FbSize) > AMemoryMgr.AddrSize)
{
- Logging.Error($"Frame buffer address {NvMap.Address:x16} is invalid!");
+ Logging.Error($"Frame buffer address {Address:x16} is invalid!");
BufferQueue[Slot].State = BufferState.Free;
@@ -365,7 +374,7 @@ namespace Ryujinx.Core.OsHle.IpcServices.Android
Interlocked.Increment(ref RenderQueueCount);
}
- byte* Fb = (byte*)Context.Memory.Ram + NvMap.Address;
+ byte* Fb = (byte*)Context.Memory.Ram + Address;
Context.Ns.Gpu.Renderer.QueueAction(delegate()
{