citra-emu
/
citra
Archived
1
0
Fork 0

Video core: Fix pixelation/blockiness in textures.

This was caused during morton decoding by me not masking the bits of
each coordinate before merging them, so the bits from x could set bits
in y if it was >255.
This commit is contained in:
Yuri Kunde Schlesner 2015-02-25 22:16:01 -03:00
parent f7c3193fec
commit 3c50da6fc0
1 changed files with 3 additions and 3 deletions

View File

@ -333,7 +333,7 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture
// Interleave the lower 3 bits of each coordinate to get the intra-block offsets, which are // Interleave the lower 3 bits of each coordinate to get the intra-block offsets, which are
// arranged in a Z-order curve. More details on the bit manipulation at: // arranged in a Z-order curve. More details on the bit manipulation at:
// https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/ // https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/
unsigned int i = (x | (y << 8)) & 0x0707; // ---- -210 unsigned int i = (x & 7) | ((y & 7) << 8); // ---- -210
i = (i ^ (i << 2)) & 0x1313; // ---2 --10 i = (i ^ (i << 2)) & 0x1313; // ---2 --10
i = (i ^ (i << 1)) & 0x1515; // ---2 -1-0 i = (i ^ (i << 1)) & 0x1515; // ---2 -1-0
i = (i | (i >> 7)) & 0x3F; i = (i | (i >> 7)) & 0x3F;