mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-22 06:37:10 +02:00
Use source texture size when doing reads for texure copy
This commit is contained in:
parent
7822348439
commit
91420a402c
2 changed files with 37 additions and 10 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue