diff options
| author | 2015-02-25 22:16:01 -0300 | |
|---|---|---|
| committer | 2015-02-25 22:16:01 -0300 | |
| commit | 3c50da6fc058ff144fb9d7329dd71dbf9b436ae3 (patch) | |
| tree | ec98c427b35fbea3212c59db370d0df35341572d /src | |
| parent | Merge pull request #575 from linkmauve/xdg (diff) | |
| download | yuzu-3c50da6fc058ff144fb9d7329dd71dbf9b436ae3.tar.gz yuzu-3c50da6fc058ff144fb9d7329dd71dbf9b436ae3.tar.xz yuzu-3c50da6fc058ff144fb9d7329dd71dbf9b436ae3.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/debug_utils/debug_utils.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index 0beb72e6b..795449423 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp | |||
| @@ -333,9 +333,9 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture | |||
| 333 | // Interleave the lower 3 bits of each coordinate to get the intra-block offsets, which are | 333 | // Interleave the lower 3 bits of each coordinate to get the intra-block offsets, which are |
| 334 | // arranged in a Z-order curve. More details on the bit manipulation at: | 334 | // arranged in a Z-order curve. More details on the bit manipulation at: |
| 335 | // https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/ | 335 | // https://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/ |
| 336 | unsigned int i = (x | (y << 8)) & 0x0707; // ---- -210 | 336 | unsigned int i = (x & 7) | ((y & 7) << 8); // ---- -210 |
| 337 | i = (i ^ (i << 2)) & 0x1313; // ---2 --10 | 337 | i = (i ^ (i << 2)) & 0x1313; // ---2 --10 |
| 338 | i = (i ^ (i << 1)) & 0x1515; // ---2 -1-0 | 338 | i = (i ^ (i << 1)) & 0x1515; // ---2 -1-0 |
| 339 | i = (i | (i >> 7)) & 0x3F; | 339 | i = (i | (i >> 7)) & 0x3F; |
| 340 | 340 | ||
| 341 | if (info.format != Regs::TextureFormat::ETC1 && | 341 | if (info.format != Regs::TextureFormat::ETC1 && |