mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-01-06 14:26:00 +00:00
Fix base offset calculation for region copies.
This commit is contained in:
parent
db2fec25c7
commit
00d0525596
|
@ -76,6 +76,9 @@ namespace Ryujinx.Graphics.Gpu.Engine
|
||||||
{
|
{
|
||||||
fixed (byte* dstPtr = dstSpan, srcPtr = srcSpan)
|
fixed (byte* dstPtr = dstSpan, srcPtr = srcSpan)
|
||||||
{
|
{
|
||||||
|
byte* dstBase = dstPtr - dstBaseOffset; // Layout offset is relative to the base, so we need to subtract the span's offset.
|
||||||
|
byte* srcBase = srcPtr - srcBaseOffset;
|
||||||
|
|
||||||
for (int y = 0; y < cbp.YCount; y++)
|
for (int y = 0; y < cbp.YCount; y++)
|
||||||
{
|
{
|
||||||
srcCalculator.SetY(src.RegionY + y);
|
srcCalculator.SetY(src.RegionY + y);
|
||||||
|
@ -83,10 +86,10 @@ namespace Ryujinx.Graphics.Gpu.Engine
|
||||||
|
|
||||||
for (int x = 0; x < cbp.XCount; x++)
|
for (int x = 0; x < cbp.XCount; x++)
|
||||||
{
|
{
|
||||||
int srcOffset = srcBaseOffset + srcCalculator.GetOffset(src.RegionX + x);
|
int srcOffset = srcCalculator.GetOffset(src.RegionX + x);
|
||||||
int dstOffset = dstBaseOffset + dstCalculator.GetOffset(dst.RegionX + x);
|
int dstOffset = dstCalculator.GetOffset(dst.RegionX + x);
|
||||||
|
|
||||||
*(T*)(dstPtr + dstOffset) = *(T*)(srcPtr + srcOffset);
|
*(T*)(dstBase + dstOffset) = *(T*)(srcBase + srcOffset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue