mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-12-23 03:25:48 +00:00
Compressed M2mf texture copy fix (#612)
Correctly calculates the number of iterations required to copy all the data from compressed textures
This commit is contained in:
parent
a2a4650108
commit
a0aecd1ff8
1 changed files with 8 additions and 0 deletions
|
@ -151,6 +151,14 @@ namespace Ryujinx.Graphics.Graphics3d
|
|||
dstCpp);
|
||||
}
|
||||
|
||||
// Calculate the bits per pixel
|
||||
int bpp = srcPitch / xCount;
|
||||
|
||||
// Copying all the bits at the same time corrupts the texture, unknown why but probably because the texture isn't linear
|
||||
// To avoid this we will simply loop more times to cover all the bits,
|
||||
// this allows up to recalculate the memory locations for each iteration around the loop
|
||||
xCount *= bpp / srcCpp;
|
||||
|
||||
for (int y = 0; y < yCount; y++)
|
||||
for (int x = 0; x < xCount; x++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue