Emulator Issues #12408
closedTexture wrapping when heights are not a power of 2 is inaccurate
0%
Description
Game Name?
Star Fox Adventures
Game ID? (right click the game in the game list, Properties, Info tab)
GSAE01
MD5 Hash? (right click the game in the game list, Properties, Verify tab, Verify Integrity button)
afb0306454b581e37a62170fdfd1de09
(this is the hash of the original game. the issue is with a modified version.)
What's the problem? Describe what went wrong.
Dolphin displays textures with non-multiple-of-four heights differently from real consoles.
What steps will reproduce the problem?
See attached fifo log. This is from a modified version of the game, but probably it happens with any game that uses such textures.
Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.
Yes, 5.0-13614
Is the issue present in the latest stable version?
Yes
If the issue isn't present in the latest stable version, which is the first broken version? (You can find the first broken version by bisecting. Windows users can use the tool https://forums.dolphin-emu.org/Thread-green-notice-development-thread-unofficial-dolphin-bisection-tool-for-finding-broken-builds and anyone who is building Dolphin on their own can use git bisect.)
N/A
If your issue is a graphical issue, please attach screenshots and record a three frame fifolog of the issue if possible. Screenshots showing what it is supposed to look like from either console or older builds of Dolphin will help too. For more information on how to use the fifoplayer, please check here: https://wiki.dolphin-emu.org/index.php?title=FifoPlayer
In Dolphin, the title screen texture (size 512x191) appears normally. On a real console, it's corrupted ("Starfox Starfox").
What are your PC specifications? (CPU, GPU, Operating System, more)
Reproduced on:
- ThinkPad T540p, Artix x64, 16GB RAM, integrated GPU
- AMD FX8320, Arch AMD64, 32GB RAM, Radeon RX590
Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)
Included patch file for the modified game if more testing is needed.
Files
Updated by Rena over 3 years ago
Actually it seems to be necessary that the height be a power of two, not just a multiple of four.
Updated by pokechu22 over 3 years ago
- Subject changed from Textures whose height is not a multiple of 4 are displayed incorrectly to Texture wrapping when heights are not a power of 2 is inaccurate
- Status changed from New to Questionable
The texture is configured to repeat; repeating functionality is only intended for use on power-of-2 texture sizes. (The repeating function isn't actually being used there, but it's enabled. Disabling it would fix the issue on console.)
YAGCD says (in the section on BP registers, specifically for TX_SETMODE1_I0 etc) that repeat and mirror "[require] the texture size to be a power of two. (wrapping is implemented by a logical AND (SIZE-1))". I've implemented that for the software renderer in pull request 9921, but I don't immediately see a good way of implementing it for the hardware renderers (it probably isn't that hard though). I'm not entirely sure if this implementation is correct, either.
Updated by JMC4789 over 3 years ago
We've implemented this in the software renderer. We're not sure if we want to open the can of worms of implementing this in the hardware renderers.
Fixed by 5.0-14736 -> https://dolphin-emu.org/download/dev/c42b1c1b9f25bfd5a5f706f7a635eb9e0d47653f/
If this is good enough for you to test things, then I think we may call it closed.
Updated by Rena over 3 years ago
I can test on real hardware, so it doesn't really affect me. I'm surprised no games have triggered this.
Updated by pokechu22 about 3 years ago
- Status changed from Questionable to Fix pending
This is fixed for the hardware renderers with Manual Texture Sampling in https://github.com/dolphin-emu/dolphin/pull/9956 (though the fix does not apply when using custom textures or higher IRs with scaled EFB copy enabled, to avoid it being accidentally triggered).
Updated by pokechu22 almost 3 years ago
- Status changed from Fix pending to Fixed
- Fixed in set to 5.0-15515
Fixed by manual texture sampling (though it isn't enabled by default): https://dolphin-emu.org/download/dev/6f4bbac528682389e34a1a4985820ee5137619c7/