http://bugs.winehq.org/show_bug.cgi?id=17423
--- Comment #7 from Stefan Dösinger stefandoesinger@gmx.at 2009-02-21 12:03:48 --- The refrast sides with the Nvidia driver.
My imagination is that something like this happened:
1) ATI and Nvidia program their drivers to honor the fog coord with table fog 2) Ubisoft writes POPSOT with this in mind 3) Nvidia figures out that its driver behaves differently than the refrast and adjusts the driver 4) Nvidia figures out that they just broke POPSOT and make a game-specific hack(The nvidia devs tell me that there are lots of them in their win drv) 5) We're left in the cold wondering what is wrong.
The ATI behavior(the one the game expects) is more intuitive(I originally expected it when writing the test), and its more flexible. The refrast/nvidia behavior is the more consistent one - it matches the fixed function pipeline's fog behavior.
I don't know what to do with this now. We could just change Wine to use the vertex shader fog coord instead of the depth if a fog coord is written and table fog used. That would fix the game, but then another game may come around that requires the opposite behavior.
Another potential clue is this website: http://news.softpedia.com/news/Prince-of-Persia-The-Sands-of-Time-Fixes-and-... It talks in a sentence about fog problems on some ATI drivers(later ones than the one for my laptop). Probably ATI changed their driver to behave like the refrast too, missed the issue with this game and fixed it in an update. I don't have an up to date ATI card+driver to check that.