aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Core/Gpu/NvGpuEngine2d.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-06-09 00:46:06 -0300
committergdkchan <gab.dark.100@gmail.com>2018-06-09 00:46:06 -0300
commit91420a402c9e786ddef2811bb671003dd0a40565 (patch)
treeb8081fb4efcf0fa2369931f72e96175ca221afff /Ryujinx.Core/Gpu/NvGpuEngine2d.cs
parent78223484394db924d02383310d8bace8a01fa152 (diff)
Use source texture size when doing reads for texure copy
Diffstat (limited to 'Ryujinx.Core/Gpu/NvGpuEngine2d.cs')
-rw-r--r--Ryujinx.Core/Gpu/NvGpuEngine2d.cs28
1 files changed, 24 insertions, 4 deletions
diff --git a/Ryujinx.Core/Gpu/NvGpuEngine2d.cs b/Ryujinx.Core/Gpu/NvGpuEngine2d.cs
index c419355e..fd19bc54 100644
--- a/Ryujinx.Core/Gpu/NvGpuEngine2d.cs
+++ b/Ryujinx.Core/Gpu/NvGpuEngine2d.cs
@@ -98,9 +98,19 @@ namespace Ryujinx.Core.Gpu
if (IsFbTexture)
{
+ //TODO: Change this when the correct frame buffer resolution is used.
+ //Currently, the frame buffer size is hardcoded to 1280x720.
+ SrcWidth = 1280;
+ SrcHeight = 720;
+
Gpu.Renderer.GetFrameBufferData(Tag, (byte[] Buffer) =>
{
- CopyTexture(Vmm, DstTexture, Buffer);
+ CopyTexture(
+ Vmm,
+ DstTexture,
+ Buffer,
+ SrcWidth,
+ SrcHeight);
});
}
else
@@ -109,13 +119,23 @@ namespace Ryujinx.Core.Gpu
byte[] Buffer = Vmm.ReadBytes(SrcAddress, Size);
- CopyTexture(Vmm, DstTexture, Buffer);
+ CopyTexture(
+ Vmm,
+ DstTexture,
+ Buffer,
+ SrcWidth,
+ SrcHeight);
}
}
- private void CopyTexture(NvGpuVmm Vmm, Texture Texture, byte[] Buffer)
+ private void CopyTexture(
+ NvGpuVmm Vmm,
+ Texture Texture,
+ byte[] Buffer,
+ int Width,
+ int Height)
{
- TextureWriter.Write(Vmm, Texture, Buffer);
+ TextureWriter.Write(Vmm, Texture, Buffer, Width, Height);
}
private long MakeInt64From2xInt32(NvGpuEngine2dReg Reg)