Closed zeromus closed 1 year ago
As background, the user is running a MacBook Air 13" 2015/2017, which has an Intel Broadwell CPU. Therefore, the user is running the AVX2 binary of the Mac version.
I have confirmed this issue on AVX2, and have found that this is just your classic off-by-one texture sampling error that can be solved by using "Enable TXT Hack" on Windows, or "Enable Fragment Sampling Hack" on macOS. (The two options are identical, in which they simply set the CommonSettings.GFX3D_TXTHack Flag.) In the v0.9.13 release, just use that option when running Fire Emblem 12, and this graphical glitch goes away.
However, when CommonSettings.GFX3D_TXTHack is false, then results become inconsistent. Here are the results of my testing, with all 3D rendering done at the native resolution:
Based on these tests, we can assume that different compiler/ISA combinations have an effect on the release builds, where SSE2/SSE3/SSSE3/SSE4.1/NEON-A64 code seems to avoid the off-by-one sampling bug, while only the AVX2 code exhibits the bug. This can also be shown in how a debug build of 0.9.13 may exhibit or avoid the bug through the use of different compiler optimizations.
The last several rounds of commits pertaining to GFX3D and SoftRasterizer have been my attempt at fixing the off-by-one sampling bug once and for all. Commit bf344e9 is the latest step in doing so, but Fire Emblem 12 seems to be a bit stubborn with this bug. But there is some good news out of this -- as of commit bf344e9, the off-by-one sampling bug seems to exhibit itself consistently across all the compiler/ISA combinations that I've tried, and so I'm hoping that we've finally moved past being at the mercy of any compiler or hardware magic that can occur when dealing with floating-point calculations.
To conclude, we can safely close this ticket for the following reasons:
We'll just have to note Fire Emblem 12 as yet another test case for this bug.
http://forums.desmume.org/viewtopic.php?id=12307&p=2 see here. This guy doesn't seem totally crazy