
Hi everyone,
Those who follow development progress regularly already know how much work and trouble has went into this branch - but it should be close to ready now.
tl;dr: Skip the next four paragraphs if you don't care about the background and just want to test the damn thing.
As a quick introduction, TEV stands for Texture EnVironment and is basically the fixed function equivalent of pixel shaders on the GC's/Wii's GPU (Flipper/Hollywood). It's highly customizable in what it does and thus, next to EFB copies, the heart of Flipper's graphics processing capabilities. Most games use TEV only in a very basic way, often making only use of one processing stage (TEV supports up to 16 of those). The most graphically taxing games make full use of the TEV feature set, so it's crucial for Dolphin to have a solid TEV emulation in place. While almost every TEV features is being emulated in Dolphin these days, accuracy turned out to be anything but good because of sloppy programming.
Maybe some of you remember the good old days when Mario's eyes didn't show up in Super Mario Galaxy (cf. this hilarious screenshot). This is a nice example of what can go wrong when you don't have accurate TEV emulation. The source of this problem is that while Flipper stores certain immediate results as 8 bit integer values, Dolphin emulates them with 32 bit floating point values. Issues arise in the alpha test, when the immediate value is expected to be equal to the reference value; but since our immediate value doesn't have the correct amount of bits the alpha test always fails for mario's eyes, and so they don't show up at all in the screenshot.
Instead of realizing that the existing code was flawed, hacks were introduced to workaround this kind of issue. In the particular example instead of properly emulating the precision of intermediate values, the alpha testing code was hacked to accept small values around the actual reference value. While "fixing" the issue in Super Mario Galaxy, the magic values used in the hack were unpredictable and sometimes broke other games so it was adjusted numerous times, effectively without improving emulation quality at all. Many people already now my hate against any sort of hacks in emulation code, and this situation once again proves my point.
Similar situations existed in the TEV code, so late 2012 I started working on the tev_fixes branch. At first I only targeted emulating precision of immediate values correctly. However, with that change a large number of games showed graphical issues, so while I was perfectly sure that my change was the more accurate emulation I hesitated committing it to master. Turned out I had to remove a vast majority of the TEV hacks in our code to make the broken games work again. On the plus side, this should fix a lot of issues. Issues possibly affected by this branch include, but aren't limited to:
Anyway, getting to the point: I'd like to ask everyone to test this branch for remaining issues in any games. I'm sure there's still a few rough edges, but without any proper reports I can't debug them. So when you find an issue, make sure to a) post a fifo log showing the issue (2 frames should be good enough usually) b) post your hardware specs. If you like, one or two performance comparisons would be appreciated, too (make sure to compare against the proper master revision, i.e. 3.5-514. Test with a high IR to make the results more clear).
Builds are available here: 32 bit 64 bit
Thanks in advance to all testers!
Those who follow development progress regularly already know how much work and trouble has went into this branch - but it should be close to ready now.
tl;dr: Skip the next four paragraphs if you don't care about the background and just want to test the damn thing.
As a quick introduction, TEV stands for Texture EnVironment and is basically the fixed function equivalent of pixel shaders on the GC's/Wii's GPU (Flipper/Hollywood). It's highly customizable in what it does and thus, next to EFB copies, the heart of Flipper's graphics processing capabilities. Most games use TEV only in a very basic way, often making only use of one processing stage (TEV supports up to 16 of those). The most graphically taxing games make full use of the TEV feature set, so it's crucial for Dolphin to have a solid TEV emulation in place. While almost every TEV features is being emulated in Dolphin these days, accuracy turned out to be anything but good because of sloppy programming.
Maybe some of you remember the good old days when Mario's eyes didn't show up in Super Mario Galaxy (cf. this hilarious screenshot). This is a nice example of what can go wrong when you don't have accurate TEV emulation. The source of this problem is that while Flipper stores certain immediate results as 8 bit integer values, Dolphin emulates them with 32 bit floating point values. Issues arise in the alpha test, when the immediate value is expected to be equal to the reference value; but since our immediate value doesn't have the correct amount of bits the alpha test always fails for mario's eyes, and so they don't show up at all in the screenshot.
Instead of realizing that the existing code was flawed, hacks were introduced to workaround this kind of issue. In the particular example instead of properly emulating the precision of intermediate values, the alpha testing code was hacked to accept small values around the actual reference value. While "fixing" the issue in Super Mario Galaxy, the magic values used in the hack were unpredictable and sometimes broke other games so it was adjusted numerous times, effectively without improving emulation quality at all. Many people already now my hate against any sort of hacks in emulation code, and this situation once again proves my point.
Similar situations existed in the TEV code, so late 2012 I started working on the tev_fixes branch. At first I only targeted emulating precision of immediate values correctly. However, with that change a large number of games showed graphical issues, so while I was perfectly sure that my change was the more accurate emulation I hesitated committing it to master. Turned out I had to remove a vast majority of the TEV hacks in our code to make the broken games work again. On the plus side, this should fix a lot of issues. Issues possibly affected by this branch include, but aren't limited to:
Anyway, getting to the point: I'd like to ask everyone to test this branch for remaining issues in any games. I'm sure there's still a few rough edges, but without any proper reports I can't debug them. So when you find an issue, make sure to a) post a fifo log showing the issue (2 frames should be good enough usually) b) post your hardware specs. If you like, one or two performance comparisons would be appreciated, too (make sure to compare against the proper master revision, i.e. 3.5-514. Test with a high IR to make the results more clear).
Builds are available here: 32 bit 64 bit
Thanks in advance to all testers!