http://bugs.winehq.org/show_bug.cgi?id=33446
--- Comment #12 from Sam Edwards CFSworks@gmail.com 2013-04-25 08:52:41 CDT --- After a lengthy discussion on IRC, we're now exploring the possibility that this may be a bug with the NVIDIA GLSL compiler. I'm using NVIDIA drivers 313.18 (but have seen this issue around since the late 2xx.xx series) and cannot test it on alternate hardware or drivers at the moment, so I'm not fully certain yet.
Attached are the results of an interesting experiment:
Attachment 44290 is a slightly-modified version of the "high" shader, provided for convenience. When compiled using my drivers, I get the assembly shown in attachment 44291.
Then, I permuted lines 50-53. Currently, the GLSL shader assigns to R3 in "x, y, z, w" order. However, if I merely change the order of the lines to "z, x, y, w" (move line 52 to before line 50), the shader begins to work correctly. Attachment 44292 is the result of the compilation.